| | |
passing parameters in ajax through php echo command
Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
•
•
hi,
i have passed following parameters in ajax function,
onclick = "agU(<?php echo $u . ' , ' . $msg; ?>);"
its not working. when i test the same function in following way it runs fine.
onclick = "agU(<?php echo $u; ?>);"
am i commiting any mistake in supplying variable???
please help..
onclick = "agU('<?=$u;?>','<?=$msg;?>');" I've used 'short tags' above - which is frowned upon [PLEEZE no more self-righteous 'I disagrees'!! IDGAD], but you can swap these for the full <?php echo $u;?> and <?php echo $msg;?> if you want.
You could also build a complete parameter string in pHp first (including quote marks) and then just include the php string - without encompassing quote marks.
From what I can see, your problem was quote marks - or should I say, the lack of them.
"...the woods would be a very silent place if no birds sang except for the best"
All opinions count.
F'enw i yw Mr. Blaidd. Byddwch yn ofalus - dwi'n cnoi.
All opinions count.
F'enw i yw Mr. Blaidd. Byddwch yn ofalus - dwi'n cnoi.
![]() |
Similar Threads
- Cascading Dropdown list with (AJAX, PHP) (PHP)
- AJAX PHP multiple dropdown (JavaScript / DHTML / AJAX)
- problem passing a NULL value to MySQL using a php variable (PHP)
- AJAX & PHP Developer ( Full Time ) (Web Development Job Offers)
- AJAX And PHP (PHP)
- passing parameters in bat file (Visual Basic 4 / 5 / 6)
- Auto fill textbox using ajax in php (PHP)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: pass arguments to event handler
- Next Thread: JavaScript
| Thread Tools | Search this Thread |
acid2 ajax ajaxcode ajaxexample ajaxhelp ajaxjspservlets animate array automatically beta box bug calendar cart checkbox class codes column createrange() css cursor date debugger decimal design dom download dropdown element embed enter error explorer firefox focus form frameworks getselection google gwt hiddenvalue hint html htmlform ie7 iframe images index internet java javascript javascripthelp2020 jawascriptruntimeerror jquery jsf jsfile jsp libcurl listbox maps masterpage media menu microsoft mimic mp4 object onmouseover paypal php player position post problem programming progressbar prototype redirect regex runtime safari scale scriptlets search security select shopping size software sql text textarea toggle unicode w3c website window windowofwords windowsxp wysiwyg





