Jump to content

Recommended Posts

So, what I'm trying to accomplish is basically putting the results of a .load() into a variable.  This way I could use the variable to set a text field value to the results of the load.

 

Is this possible, or would I have to use .load() into a hidden div and get the html of the div as the variable?

Link to comment
https://forums.phpfreaks.com/topic/228874-jquery-load-in-val/
Share on other sites

I don't see how that'd help, since I'm tryin' to load like 2 words from another page into a text field upon pressing tab.

 

This is for my chat, and I want it to automatically type "/msg {USER} " for the last person that sent you a PM upon pressing {TAB}.  I figured, since it will change constantly, that loading it from a separate page that can run the query would be the best bet, rather than a refresh to update who messaged you last.

 

Also, when I tried using a hidden div, it went too fast and would fill the div, but then the html of the div wouldn't be picked up on the first time 'round, which means they would be one behind everytime they used the hotkey.

 

Maybe I would be better off just leavin' this option out .. :(

Link to comment
https://forums.phpfreaks.com/topic/228874-jquery-load-in-val/#findComment-1179865
Share on other sites

Basically it comes down to this. If you want to get dynamic content and load it into the page right away upon download, use load(). If you want to get dynamic content and not use it right away (i.e. put it into a variable), use one of the three functions I gave you.

Link to comment
https://forums.phpfreaks.com/topic/228874-jquery-load-in-val/#findComment-1179889
Share on other sites

Sorry about that, I'm just new to JQuery and didn't fully comprehend what you were talking about.  I have searched what you said on Google and was able to figure it out.  Thanks a ton for your help, it worked great.

Link to comment
https://forums.phpfreaks.com/topic/228874-jquery-load-in-val/#findComment-1179938
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.