Saturday, October 29, 2011

missing ) after argument list error - how does that make sense?

Hi everyone,

I am using JQuery to pass parameters from my view to the controller.
It works fine, until I add the parameter "title".

in my view, a php function passes the values that I retrieve from the
database:
-----------------------------------------------------------------------------------------------------------------

echo '<div id="showGoogleMap" onclick="showGoogleMap('.$all['id'].','.
$all['BooksUser']['latitude'].',
'.$all['BooksUser']['longitude'].','.$all['title'].')"
style="float:right;cursor:pointer;">'.$html->image("icons/map.png",
array("alt" => "Google Map anzeigen")).'</div>';

the jquery function showGoogleMap() passes those values to my
controller:
-----------------------------------------------------------------------------------------------------------------

function showGoogleMap(input, input_latitude, input_longitude, title)
{

$("#map_popup").load('/test/users/map', {'latitude': input_latitude,
'longitude': input_longitude, 'title': title}, function()

}


that jquery function loads "ajax like" a google map. now when I hit
the icon to open the map, firebug says this:
-------------------------------------------------------------------------------------------------------------------------------------------------------------

missing ) after argument list
showGoogleMap(207,47.378824,8.548737,Tag Heuer Carrera Chronograph)

the passed values have these types:
id is bigint
longitude and latitude are character varying
title is character varying

is it because of the blanks in "Tag Heuer Carrera Chronograph"?? is
that causing the error?

thanks a lot :)

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

No comments: