fredted40x Posted April 21, 2010 Share Posted April 21, 2010 Hi, Im trying to call a ajax function and send a string that the ajax javascript function can use. So far i have <a href="#dd" onclick="sh()">Fly</a> And i want to send with the link a string e.g. "thanks". How can i send the string and use it in the seperate ajax file? Thanks Link to comment https://forums.phpfreaks.com/topic/199275-pass-string-from-html-to-ajax/ Share on other sites More sharing options...
F1Fan Posted April 21, 2010 Share Posted April 21, 2010 You can just pass it into your function, but where's the rest of your applicable code? Link to comment https://forums.phpfreaks.com/topic/199275-pass-string-from-html-to-ajax/#findComment-1045931 Share on other sites More sharing options...
fredted40x Posted April 21, 2010 Author Share Posted April 21, 2010 How do you pass though. There isnt any more code thats worth posting as its the first thing the function should so, assign a variable with that string. Link to comment https://forums.phpfreaks.com/topic/199275-pass-string-from-html-to-ajax/#findComment-1045933 Share on other sites More sharing options...
Mchl Posted April 21, 2010 Share Posted April 21, 2010 <a href="#dd" onclick="sh('thanks')">Fly</a> ?? Link to comment https://forums.phpfreaks.com/topic/199275-pass-string-from-html-to-ajax/#findComment-1045939 Share on other sites More sharing options...
fredted40x Posted April 21, 2010 Author Share Posted April 21, 2010 sorted, thank you for that. Feel a bit stupid now but couldnt get it to work. Link to comment https://forums.phpfreaks.com/topic/199275-pass-string-from-html-to-ajax/#findComment-1045942 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.