Welcome Guest, Not a member yet? Register   Sign In
How to load page fragments from another file and display it using jQuery load()function
#1

[eluser]ethio[/eluser]
Code:
$(document).ready(function() {
$('#items').load("<?php echo site_url('home/new_items'); ?>");
});

Using jQuery I am able to display a whole page, that 'home/new_items' calls using the above code but how do I only display parts of the file? $('#result').load('ajax/test.html #container'); In the example it shows this is possible, so how do I use this in codeigniter?
#2

[eluser]LuckyFella73[/eluser]
Basically it should work like in the jquerys example.
Did you allready try and just got an error? If
yes please provide the code you have especially the
jquer load having the "#container" or whatever id you
use and the html output of the whole html "file" containing
the id element you want to "crop".
#3

[eluser]ethio[/eluser]
I don't know why it didn't work earlier, there were no errors just a blank page. But it fixed itself, and as you said it works in the same way as the example.




Theme © iAndrew 2016 - Forum software by © MyBB