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" );
319 questions
3
votes
3 answers

Document ready function not working in nested html page : jQuery

I have a HTML page which having 1 div.
and having This mySecondHtmlPage.hmtl is loading but I want to have another…
sudhir
  • 1,289
  • 3
  • 23
  • 39
3
votes
2 answers

Jquery load() doesn't load script tags in div

Page 1 has a Menu with id (#navigation), with a link called Page2 and DIV with id (global_content) that shows contents when the link Page2 is clicked. In the same page (Page 1) I wrote a jquery load function, so that when I click the link it should…
3
votes
2 answers

Partial View click event not fire

My *.aspx Page (main page): function getEmployeeHours(employeeId,year,month) { $('#clocked-details').load('/Employees/GetEmployeeClockedHours/',{ 'employeeId': employeeId,'year': year,'month': month }); }; My partial view *.ascx : …
Sampath
  • 50,641
  • 40
  • 250
  • 357
3
votes
1 answer

jQuery how to load content when back button is clicked

I am using jQuery to load page content when a link is clicked, $(document).on('click', 'nav a', function (e) { e.preventDefault(); var url = $(this).attr("href"); window.history.pushState('', '', url); url += " #main_wrapper > *"; …
Dhruv Kumar Jha
  • 5,649
  • 7
  • 33
  • 47
3
votes
1 answer

read source of EXTERNAL webpage in ajax or jquery (no yql+JSON / no php / no iframe)

I want to read the html source code of say www.google.com with ajax or jquery (I don't just want to display the source, i need to parse it, so having xmlhttp.responseText is nice). read contents of an external webpage and get specific elements has a…
dako
  • 31
  • 5
3
votes
3 answers

jquery .load( ) and trigger function AFTER new content loads? just like JavaScript onload event

Using jquery, I am swapping some content in a web page by use of jquery's .load() function. I want to trigger an event immediately once the content has actually been loaded, but not before and not after. I'm up for any graceful solution! Why? In…
Slink
  • 253
  • 1
  • 3
  • 14
3
votes
3 answers

display html file in a div

I've been trying to search for a way to do this as I'm sure there's hundreds of websites explaining it but I just can't word it right so all my searches come up with something else. So I'm sorry if this has been asked many times before. Anyway, what…
Chumps
  • 31
  • 1
  • 1
  • 2
3
votes
1 answer

.load() not firing for uncached images - jquery

in safari and opera, the callback function of .load doesn't wait for uncached images to be fully loaded. with cached images it works perfectly fine. the code is a little complicated, i'll try to simplify... so, my js is this: …
Ben Greene
  • 147
  • 1
  • 15
3
votes
2 answers

Override when using jquery .load to get content

I've got a few pages, all with different content, the pages are all linked in the nav using relative path tags. What I'd like to do from a usability point of view is to use jquery .load to get the content from the other pages and load it into the…
sam
  • 8,194
  • 30
  • 94
  • 152
3
votes
1 answer

TinyMCE bug via jquery load

I have this kind of strange bug when I load tinymce via jquery load, After the first time I click the dropdown to select one item from the list (bullet list, number list, style list, paragraph list), I get the bug as shown in the image when I…
laukok
  • 47,545
  • 146
  • 388
  • 689
2
votes
1 answer

jQuery.load() on an MVC 3 partial view only calls the server once (not a rebind issue)

The following code shows 1 view, 1 partial view, and 1 controller. The view contains a button to get the current time and a partial view that displays that time. The button's click, wired through jQuery, calls $.load() on the partial view's…
denious
  • 163
  • 1
  • 10
2
votes
1 answer

JQuery callback and return to the first call?

I for this function to load an external page. Page URL grab from DIV id. $(".contentArea").load($('.contentArea').attr('id'), function(){ The page loaded, got a datatable so I added it to the callback. $('.datatable').dataTable( { Inside the…
Henrique
  • 409
  • 6
  • 22
2
votes
4 answers

jQuery .load() - measure the time

I'm using jquery .load() to load some external(but within same domain) resourses into the page. As this action is not visible through FireBug Network / Chrome Network console - how can I measure the time of loading? EDIT: If running locally ( not…
Iladarsda
  • 10,250
  • 38
  • 99
  • 165
2
votes
2 answers

Jquery .html() and jquery .load

I have a page which is divided in to many tabs , with each tab pulling data from another pages through ajax. After the ajax call, i use a .html ( data ) where data is the html of called page to insert it in to the tab. My question is , if the…
srini
  • 89
  • 4
  • 15
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
  • 655
  • 3
  • 15
  • 29
1 2
3
21 22