AJAX Forums

Help with JavaScript?

This is a discussion on Help with JavaScript? within the JavaScript forums, part of the Beginners AJAX category; I'm trying to pass a php variable to a javascript function like this:My JavaScript function is set up like thisfunction qna(id) { if (Element.empty('qna-content')) { new ...


Go Back   AJAX Forums > Beginners AJAX > JavaScript

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
Old 05-24-2007, 11:53 AM   #1 (permalink)
Junior Member
 
Join Date: May 2007
Posts: 1
Rep Power: 0 RobbDogg is on a distinguished road
Help with JavaScript?

I'm trying to pass a php variable to a javascript function like this:My JavaScript function is set up like thisfunction qna(id) { if (Element.empty('qna-content')) { new Ajax.Updater('qna-content', 'ajaxtestbackend.php?id='How do you print the id variable so that new Ajax.Updater('qna-content', 'ajaxtestbackend.php?id=' looks like this:new Ajax.Updater('qna-content', 'ajaxtestbackend.php?id=1'or what ever the current id is. I guess I'm asking is how do you place a variable inside a string of text that is already inclosed by quotes?
__________________
RobbDogg is offline   Reply With Quote
Old 05-24-2007, 06:11 PM   #2 (permalink)
Junior Member
 
Join Date: May 2007
Posts: 1
Rep Power: 0 Pens66 is on a distinguished road
I am thinking you want to do this:new Ajax.Updater('qna-content', 'ajaxtestbackend.php?id='+id
__________________
Pens66 is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes



All times are GMT -4. The time now is 09:37 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5
Copyright ©2006 - 2008, AJAXwith.com