garry27 Posted February 4, 2007 Share Posted February 4, 2007 document.getElementById("pp-div2").innerHTML = " <a class='center-all' href='javascript:addPubFn(" +pubID+','+pubName+','+ pubPostcode+ ")'>Add to Pub Crawl</a>"; Link to comment https://forums.phpfreaks.com/topic/36999-anyone-know-why-i-get-missing-after-argument-list-with-this/ Share on other sites More sharing options...
garry27 Posted February 4, 2007 Author Share Posted February 4, 2007 javascript sucks! Link to comment https://forums.phpfreaks.com/topic/36999-anyone-know-why-i-get-missing-after-argument-list-with-this/#findComment-176629 Share on other sites More sharing options...
fenway Posted February 5, 2007 Share Posted February 5, 2007 Your quoting is inconsistent. Link to comment https://forums.phpfreaks.com/topic/36999-anyone-know-why-i-get-missing-after-argument-list-with-this/#findComment-177187 Share on other sites More sharing options...
garry27 Posted February 5, 2007 Author Share Posted February 5, 2007 the following code works when i pass integer variables but not strings. document.getElementById("pp-div2").innerHTML = "<a href='#' onClick='addPubFn(" + var1+ "," + var2+ "," + var3+ "); return false;'>Add to Pub Crawl</a>"; changeBodyClass("pp-div2-hide","pp-div2-show"); i just get the same error. you can see this for yourself by clicking on a marker and then the add pub link in the panel here: http://www.nl-webspace.co.uk/~unn_p921847/s2/create_crawl.php?call=2&postcode=dl3+7&lat=54.524800208734&lng=-1.5606556890128# very odd Link to comment https://forums.phpfreaks.com/topic/36999-anyone-know-why-i-get-missing-after-argument-list-with-this/#findComment-177435 Share on other sites More sharing options...
fenway Posted February 5, 2007 Share Posted February 5, 2007 No, not strange at all... you're not quoting your JS parameters. Link to comment https://forums.phpfreaks.com/topic/36999-anyone-know-why-i-get-missing-after-argument-list-with-this/#findComment-177479 Share on other sites More sharing options...
garry27 Posted February 5, 2007 Author Share Posted February 5, 2007 ye, but when i do it still doesn't work Link to comment https://forums.phpfreaks.com/topic/36999-anyone-know-why-i-get-missing-after-argument-list-with-this/#findComment-177497 Share on other sites More sharing options...
fenway Posted February 5, 2007 Share Posted February 5, 2007 It should be "<a href='#' onClick='addPubFn("' + var1+ "','" + var2+ "','" + var3+ "'); return false;'>Add to Pub Crawl</a>"; changeBodyClass("pp-div2-hide","pp-div2-show"); Link to comment https://forums.phpfreaks.com/topic/36999-anyone-know-why-i-get-missing-after-argument-list-with-this/#findComment-177535 Share on other sites More sharing options...
garry27 Posted February 5, 2007 Author Share Posted February 5, 2007 that doesn't work either. i get 'missing ; before statement' Link to comment https://forums.phpfreaks.com/topic/36999-anyone-know-why-i-get-missing-after-argument-list-with-this/#findComment-177582 Share on other sites More sharing options...
fenway Posted February 5, 2007 Share Posted February 5, 2007 Sorry, my bad... the quoting is horrible. "<a href='#' onClick='addPubFn(\"" + var1+ "\",\"" + var2+ "\",\"" + var3+ "\"); return false;'>Add to Pub Crawl</a>"; changeBodyClass("pp-div2-hide","pp-div2-show"); Link to comment https://forums.phpfreaks.com/topic/36999-anyone-know-why-i-get-missing-after-argument-list-with-this/#findComment-177746 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.