phpdemon Posted September 25, 2009 Share Posted September 25, 2009 Ok this is my first post here so hopefuly some one can help... Im passing a value from a normal html input box to a facebook ajax function. My problem that i am having is that when there is more then one word in the input box i get a error with the code that it brings back, it says that my java script vars "ga" "s" are undefined. Then "g" where im two words are coming from only shows one word. Btw when i just use one word it all works. Anyways I believe its the space in between the two words in the input field thats screwing me up. Does any one have any idea on how to solve this thanks... Below i is my ajax function. remember this is facebook code so its going to differ from normal. function do_ajax8() { var g = document.getElementById('g').getValue(); var s = document.getElementById('s').getValue(); var ga = document.getElementById('ga').getValue(); var ajax = new Ajax(); ajax.responseType = Ajax.FBML; ajax.requireLogin = true; ajax.ondone = function (data) { // var myDial = new Dialog(Dialog.DIALOG_POP); // myDial.showMessage("Test",data) document.getElementById('sideBox3').setInnerFBML(data); } ajax.post('http://66.237.84.68/guildaddff.php?g='+g+'&s='+s+'&ga='+ga); } Link to comment https://forums.phpfreaks.com/topic/175461-some-php-ajax-help/ Share on other sites More sharing options...
phpdemon Posted September 25, 2009 Author Share Posted September 25, 2009 Ok so i cant believe any one could help me.... It was easy as adding a escape() to my javascript Link to comment https://forums.phpfreaks.com/topic/175461-some-php-ajax-help/#findComment-924615 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.