Questions tagged [jquery-load]

The .load() method in jQuery provides the ability to load content into the selected elements.

The .load() Load data from the server and place the returned HTML into the matched element.

.load( url [, data ] [, complete ] )

This method is the simplest way to fetch data from the server. It is roughly equivalent to $.get(url, data, success) except that it is a method rather than global function and it has an implicit callback function. When a successful response is detected (i.e. when textStatus is "success" or "notmodified"), .load() sets the HTML contents of the matched element to the returned data. This means that most uses of the method can be quite simple:

Example:

$( "#result" ).load( "ajax/test.html" );
318 questions
2
votes
1 answer

Using jQuery load() on dynamic content

I'm trying to load content into a DIV with jQuery load() but it is not working if the link that calls the function is generated after page load. var ajax_load = "loading...
elbatron
  • 675
  • 3
  • 16
  • 30
2
votes
2 answers

Appending external PHP file in jQuery

I'm referring a question answered here. Trying to append an external PHP file in to jQuery and tried load. $(".chatbox").load("./one.php"); This gives me the output; Your success message! However the concern is this removes all HTML in the body…
Mohan Wijesena
  • 225
  • 1
  • 3
  • 11
2
votes
1 answer

Knockout bindings when using Jquery load to fill a jquery ui dialog

I'm sure I'm fundamentally misunderstanding something here but can't for the life of me work it out. I'm using a jquery ui dialog to create a form popup. The view for the form is in a separate file so on opening the dialog I'm using Jquery.load()…
2
votes
4 answers

Jquery .load / .empty not loading and emptying content from div

Im trying to load select content that is hidden on a page into a content div. To do to this i came across jquery's .load and .empty. It seems to have gone wrong somewhere, but as far as i can see it should work,ideas where im going wrong on this ?…
sam
  • 9,486
  • 36
  • 109
  • 160
2
votes
1 answer

jQuery UI Dialog - change the content of an open dialog (Ajax)

I've got some links I want to have dynamically open in a jQuery UI Dialog using jQuery.load(). Once the dialog is open, I want the links load inside the already opened dialog. So, the site loads, you click a link, and it opens in a dialog. That's…
morewry
  • 4,320
  • 3
  • 35
  • 35
2
votes
3 answers

How to load hyperlinked file to a targeted/certain a div dynamically?

I'm having a problem on how will I target, here's the scenario, whenever I click the links Home, or food or resort etc. the contents of it should be outputted on the display below. What always happen is that when I click those links It always goes…
2
votes
1 answer

jQuery load missing argument

I have code like this function firstload(maxid, next_page, results, animation_image, btn_load, url, endpoint) { var a = ''+maxid+''; var b = ''+next_page+''; var c = ''+endpoint+''; $('#'+results+'').load('
dionajie
  • 404
  • 1
  • 7
  • 19
2
votes
4 answers

Load text from specific external DIV using AJAX?

I'm trying to load up the estimated world population from http://www.census.gov/ipc/www/popclockworld.html using AJAX, and so far, failing miserably. There's a DIV with the ID "worldnumber" on that page which contains the estimated population, so…
Josh
  • 233
  • 1
  • 4
  • 19
2
votes
1 answer

How to check if image url has been loaded with jQuery?

I have this code here where I have a slider with thumbnails and the sliders large image takes it's next attr('src') from the click on a thumb, but I'd like to change that src only when the image has loaded. This is the source that I've come up with…
Xeen
  • 6,955
  • 16
  • 60
  • 111
2
votes
1 answer

Append and Load from an array

I'm pretty new to javascript and jQuery in general and I've been working on this script for about 3 days now. I searched around for a solution to this but wasn't able to find it yet. I guess my search skills suck. So, I'm trying to load an element…
Dara
  • 23
  • 2
2
votes
1 answer

jquery infinite scroll not working when calling through jquery load

I am using jquery infinite scroll plugin for pagination and it is working good when running the page directly to the browser. But if I call the page through jquery load method it doesn't work. I can get the first set of results and then I can't even…
Vasanthan.R.P
  • 1,277
  • 1
  • 19
  • 46
2
votes
2 answers

Trigger jQuery's $(window).resize only after $(window).load

I want something to happen when I resize my browser window, but every thing on the page must be loaded first. This doesn't work, but you get the picture: $(window).resize(function(){ $(window).load(function(){ // do stuff …
Robin Cox
  • 1,470
  • 2
  • 16
  • 31
2
votes
1 answer

Using jquery .load() in Rails

I want to fetch a table from a .html file and show it in a div in my .html.erb file... I tried with loading a simple .txt file as below but its now working.. Please let me know what changes are to be done. Am I going wrong in giving the…
Aks..
  • 1,343
  • 1
  • 20
  • 42
2
votes
3 answers

Load html content in div

I am trying to load the content from another html file into my existing html file using jquery .load But unfortunately it is not loading the content. Please suggest me with the proper solution. Here is my existing html and jquery to load content…
Sowmya
  • 26,684
  • 21
  • 96
  • 136
2
votes
1 answer

Why does jQuery.load not handle relative links?

I'm using some basic jQuery to speed up my site by replacing the content via AJAX rather than fully reloading the page (similar to what Turbolinks does): $("nav").delegate("a", "click", function() { href = $(this).attr('href'); …
Zaz
  • 46,476
  • 14
  • 84
  • 101