Jump to content

JQuery .load() in .val()


codefossa

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

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.