Welcome Guest, Not a member yet? Register   Sign In
JS nightmares
#7

[eluser]k7faq[/eluser]
@umefarooq

Thank you. Yes. First I call the controller and POST a to, from and distance fields to the controller which passes them on as it calls a view. In the view the Google Maps JS App runs and uses the to, from and distance to call the routeBoxer, distance and directionService APIs. Once the APIs have run I capture the coordinates of the routeBoxer result and pass them back to the CI Controller:
Code:
$.ajax({
    type : "POST",
    url : "http://www.shiprightnow.com/custom/map/search",
    data : "&coords;=" + boxes,
    dataType: "json",
    success:  function(data){$("#result").html(data);}
  });
Post Data:
Code:
coords    ((34.210144882666555, -111.80111777590123), (34.67328658844438, -102.11798)),((34.67328658844438, -112.3707141156601), (35.136428294222185, -96.42201660241108)),((35.136428294222185, -112.3707141156601), (35.59957, -95.28282392289329)),((35.59957, -112.3707141156601), (36.06271170577782, -107.24434705783005)),((35.59957, -104.96596169879449), (36.06271170577782, -91.8652458843399)),((36.06271170577782, -98.70040196144664), (36.52585341155563, -91.8652458843399)),((36.52585341155563, -96.99161294216995), (36.98899511733345, -91.8652458843399))

Once the CI Controller/Function has parsed the Coordinates it is passing them back to the page (currently just for view, will be several other objects of data after I get past this hurdle):
CI function:
Code:
$data['coords'] = (parseCoords($_POST['coords']));
    echo 'uri is<br />';
    print_r($this->uri->uri_string()); echo '<p>';
    print_r($_POST); print_r($_GET);
    echo '<p />thats it';
At this point I can see the result of the above in the header via FireBug. However, this data never makes it to the display:
capture Result from Firebug:
Code:
<table><tr><td></td></tr></table>uri is<br />/map/search<p>Array
(
    [coords] => ((34.210144882666555, -111.80111777590123), (34.67328658844438, -102.11798)),((34.67328658844438, -112.3707141156601), (35.136428294222185, -96.42201660241108)),((35.136428294222185, -112.3707141156601), (35.59957, -95.28282392289329)),((35.59957, -112.3707141156601), (36.06271170577782, -107.24434705783005)),((35.59957, -104.96596169879449), (36.06271170577782, -91.8652458843399)),((36.06271170577782, -98.70040196144664), (36.52585341155563, -91.8652458843399)),((36.52585341155563, -96.99161294216995), (36.98899511733345, -91.8652458843399))
)
Array
(
)
<p />thats it

Am I not pointing JS to the proper div id? I have no idea as to what the problem is at this point...


Messages In This Thread
JS nightmares - by El Forum - 12-26-2010, 10:06 PM
JS nightmares - by El Forum - 12-26-2010, 10:19 PM
JS nightmares - by El Forum - 12-26-2010, 11:02 PM
JS nightmares - by El Forum - 12-27-2010, 01:13 AM
JS nightmares - by El Forum - 12-27-2010, 10:37 PM
JS nightmares - by El Forum - 12-27-2010, 11:08 PM
JS nightmares - by El Forum - 12-28-2010, 09:08 AM
JS nightmares - by El Forum - 12-28-2010, 04:46 PM
JS nightmares - by El Forum - 12-28-2010, 07:49 PM



Theme © iAndrew 2016 - Forum software by © MyBB