can I do this in jquery ?

Soldato
Joined
24 Jan 2008
Posts
4,336
Location
By Coffee cup...
Just a quick one...
I plan to use jquery load to loads div's in to other div's...(for my www so logo menu and footer stays same all the time and I call for content for main container div)

I am unable to find a way how to link a script to a either button in html so once pressed to call for fscript or link it to a text ( one of menu items)

Any ideas??

Big thanks for any suggestions!!!
Lukas
 
Dynamically loading all content means that it might be difficult or impossible for users to bookmark or share pages within your site, especially if the URL doesn't change.
 
Dynamically loading all content means that it might be difficult or impossible for users to bookmark or share pages within your site, especially if the URL doesn't change.

I understand but and will take this in to mind ( havent thought about this lol )

But still...is there a way ? as it is only thing stopping me from finishing my www :) (after I had problems with setting slideshow in jquery the way I wanted ;) )

I know that some people would say that I could do it easy way and 'old style' - every single item from Menu has its own web page...but I like to create problems for myself ;)
 
Maybe I've misunderstood what you're trying to achieve... but isn't that a job for PHP includes? Google it.

What happens in cases where your visitor has Javascript disabled? PHP doesn't have that problem as it's server side.
 
Maybe I've misunderstood what you're trying to achieve... but isn't that a job for PHP includes? Google it.

What happens in cases where your visitor has Javascript disabled? PHP doesn't have that problem as it's server side.

will look in to PHP include as well then...

are slideshows in php difficult to do/set ?


off to google...
 
Sounds like your wanting to use an ajax request to pull content in from another file and yes this can be done via jQuery - http://api.jquery.com/jQuery.ajax/

But depending on why your wanting to do this it might not be the most elegant solution.

answer for Why? is quite simple...but maybe there is another sollution - like this php inlcude

Why ? I want logo, menu and footer to load once as it is main content that will be changing depending whats chosen from menu ( ie gallery, contact me, about etc)
 
If you aim is to only load that content on the browser once then any server side includes will not help as the content will still be loaded upon each request, although all assets will be cached by the browser...

Are you wanting to reduce the content loaded for the user or save you the effort of duplicating content?
 
I know, .load() automatically dumps the contents of the ajax response into the targeted selector. You could have course do this with .ajax() as well, you'd just need to write the success handler yourself.
 
It's not worth the effort then :) as any assets (images, stylesheets, javascript) will already be cached in the users browser and will not be requested from your server on each additional request.

If you was trying to stop yourself from having to write the same content in multiple files I could understand why, but to reduce the load for the user is really pointless task for a static site.
 
It's not worth the effort then :) as any assets (images, stylesheets, javascript) will already be cached in the users browser and will not be requested from your server on each additional request.

If you was trying to stop yourself from having to write the same content in multiple files I could understand why, but to reduce the load for the user is really pointless task for a static site.

but it would save on my server transfers as well wouldnt it ?


in the end, as you say, go easy way and just make single webpages...
 
but it would save on my server transfers as well wouldnt it ?


in the end, as you say, go easy way and just make single webpages...

Any cached assets wouldn't even be requested from your server a second time, if your looking to reduce bandwidth you want to be looking at caching and compression not AJAX and server side includes :)
 
Any cached assets wouldn't even be requested from your server a second time, if your looking to reduce bandwidth you want to be looking at caching and compression not AJAX and server side includes :)

whatever it means lol :)

Thanks

so lets say thats a problem solved in a way...time to get nice gallery in place.
 
Back
Top Bottom