Jump to content

javascript function call


anujgarg

Recommended Posts

I have a javascript function creating a string and assigned into a variable named url

ie

url = http://localhost/abc/xyz/2/5/7

 

Also, This function does not return this string, as this string is further being used in AJAX incorporation.

 

Now I want to get this string in another javascript function.

 

Is it possible to do this? (As the prev function is not returning the desired string.)

 

Link to comment
https://forums.phpfreaks.com/topic/124482-javascript-function-call/
Share on other sites

What about setting the innerHTML or value of an element in the first function, then reading that value with the second function?

 

function setURL() {

    var url = 'http://localhost/abc/xyz/2/5/7';

    getElementById('elName').innerHTML = url;

}

 

function getURL() {

  //blah, get innerHTML from elName

 

}

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.