Jump to content

[SOLVED] Please help: Variable in a link


theagent

Recommended Posts

Hi, I'm using this AJAX function here: http://www.devpapers.com/article/328. I don't think that's important for my question, however.

 

I'm trying to do something like this:

ajax_do('http://www.variable.com');

 

"Variable" is a JavaScript variable. I have to embed it in the link somehow... any ideas?

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/128232-solved-please-help-variable-in-a-link/
Share on other sites

ajax_do(url_variable);

or

ajax_do('http://' + url_variable);

depending on how your urls are stored...

 

ajax_do('http://' + url_variable);

Unfortunately, this creates "http://url_variable" and it treats url_variable like a string rather than a variable.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.