Reply
Implementing AJAX for basic graphics ???
Old 11-01-2009, 03:35 PM Implementing AJAX for basic graphics ???
tomcat_fo's Avatar
Ultra Talker

Posts: 272
Trades: 0
Hi


Can someone give me an example on how to implement Ajax into a PHP-website to speed up loading on basic graphics that otherwise will be loaded again and again.

I include different files with functions into my index.php file but whatever people click on the graphics on the website is pretty much the same.

My website has a graphic background, a logo, and all content is framed in a graphic frame, wich is built by several small images.

Soe... could someone please give me an example on how to use AJAX in a site written in PHP, where graphic files are place in a directory e.g. /websitefiles/graphics
tomcat_fo is offline
Reply With Quote
View Public Profile
 
 
When You Register, These Ads Go Away!
Old 11-01-2009, 03:44 PM Re: Implementing AJAX for basic graphics ???
chrishirst's Avatar
Super Moderator

Posts: 22,245
Location: Blackpool. UK
Trades: 0
Just leave it up to the browser to cache images, messing about with AJAX will do pretty much the exact opposite of what you hope to accomplish.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Growing old is mandatory - Growing up is optional
Code Samples | People Counting System | Bits & Bobs
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 11-01-2009, 04:19 PM Re: Implementing AJAX for basic graphics ???
tomcat_fo's Avatar
Ultra Talker

Posts: 272
Trades: 0
Ok... when does it so in your opinion make any sense using AJAX ?
tomcat_fo is offline
Reply With Quote
View Public Profile
 
Old 11-01-2009, 05:43 PM Re: Implementing AJAX for basic graphics ???
chrishirst's Avatar
Super Moderator

Posts: 22,245
Location: Blackpool. UK
Trades: 0
sparingly is my opinion

As usual it is a useful method that is massively overused by developers who want to be (or at least appear) "kewl".
Using it "just because you can" is not really a valid reason.

In the case you portray doesn't really warrant using AJAX simply because there are "issues" with IE being unable to reuse an existing XMLHTTP object so subsequent calls will fail.
A simpler solution would be to use "tabboxes" and simply show or hide the content element in the same location.
This method is also "SE Friendly" whereas AJAX loading content is not.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Growing old is mandatory - Growing up is optional
Code Samples | People Counting System | Bits & Bobs
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 11-01-2009, 09:31 PM Re: Implementing AJAX for basic graphics ???
wayfarer07's Avatar
NYE-KEE

Posts: 3,155
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
Like Chris says, AJAX is a nice technology set, but it isn't a magic bullet, and should only be used if there is a real need. AJAX is used by developers, who know what they are doing, for creating interactive web applications, usually connected to a database, which change the content of the page in real time in response to user input or other conditions.

The normal state of the web is a static state, simply relaying information one page at a time. Most people don't need an event-based application state with AJAX, so unless you're designing something that has a rich response to the user, you shouldn't be considering it.
__________________
Wayfarer | jQuery Tooltip Plugin | Mapbox: the jQuery Map
Freelance Jobs Available
If Google is the Coca-Cola of Web search, Bing is RC Cola
wayfarer07 is online now
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Reply     « Reply to Implementing AJAX for basic graphics ???
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 



Page generated in 0.23892 seconds with 13 queries