[jQuery] Pull Text from .txt file and insert into div |
[jQuery] Pull Text from .txt file and insert into div |
Egolfius |
Dec 27 2014, 03:00 PM
Post
#1
|
Group: Members Posts: 3 Joined: 25-December 14 Member No.: 21,967 |
Is this something I can do with jQuery? I've tried .get, but perhaps I wasn't using it correctly?
CODE $.get( "text/" + page + "/" + i + ".txt", function( data ) { $("#l_col a:nth-child(" + i + ")").append("<div id='info'>" + data + "</div>"); }); I am extremely new to jquery, so the help is much appreciated. This post has been edited by Egolfius: Dec 27 2014, 03:06 PM |
Christian J |
Dec 27 2014, 04:02 PM
Post
#2
|
. Group: WDG Moderators Posts: 9,653 Joined: 10-August 06 Member No.: 7 |
Is this something I can do with jQuery? You can do it with Ajax through jQuery (which I'm not familar with), if the file is on the same domain. QUOTE I've tried .get, but perhaps I wasn't using it correctly? No, that only seems to retrieve DOM elements: http://api.jquery.com/get/ |
Lo-Fi Version | Time is now: 19th April 2024 - 07:42 PM |