Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
change content of the content div onclick, without reloading the whole page?
Old 11-21-2010, 02:35 PM change content of the content div onclick, without reloading the whole page?
matt w's Avatar
Super Talker

Posts: 136
Location: kalamazoo
Trades: 0
I have a project on which my people want to change the content column of the page when a menu item is clicked, without reloading the whole page. This is exactly what Ajax is good for isn't it? I don't want to use iframes because they often insert (unsightly) scroll bars. Any ideas? Where can I find tutorials that will lead me through coding the necessary scripts?
Thanks,
Matt
matt w is offline
Reply With Quote
View Public Profile Visit matt w's homepage!
 
 
Register now for full access!
Old 11-21-2010, 06:42 PM Re: change content of the content div onclick, without reloading the whole page?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,383
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
http://www.w3schools.com/ajax/default.asp
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 11-21-2010, 06:44 PM Re: change content of the content div onclick, without reloading the whole page?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,383
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
BTW

Search engines cannot read text loaded with AJAX.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 11-24-2010, 12:37 PM Re: change content of the content div onclick, without reloading the whole page?
CSM
CSM's Avatar
Front-End Developer

Posts: 297
Name: Michael Pehl
Location: Palma de Mallorca
Trades: 0
jQuery .ajax or .load or .get
__________________
Chief Web Officer / Front-End Developer / System Engineer

Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
CSM is offline
Reply With Quote
View Public Profile Visit CSM's homepage!
 
Old 11-25-2010, 07:37 AM Re: change content of the content div onclick, without reloading the whole page?
Average Talker

Posts: 28
Trades: 0
Just put the secondary content in a div which has display:none. Then when clicking you just swap the display parameter on the first div to none and the second one to block with a javascript function.
Phil18 is offline
Reply With Quote
View Public Profile
 
Old 11-25-2010, 07:53 AM Re: change content of the content div onclick, without reloading the whole page?
Mime's Avatar
Extreme Talker

Posts: 164
Name: Seb
Trades: 0
There is a better way that doesn't even need Javscript: http://www.impressivewebs.com/demo-f...-switcher.html
Mime is offline
Reply With Quote
View Public Profile
 
Old 12-08-2010, 12:45 PM Re: change content of the content div onclick, without reloading the whole page?
matt w's Avatar
Super Talker

Posts: 136
Location: kalamazoo
Trades: 0
Let me back up a moment. I am talking about loading images, links, text, whole pages into the content div.

Do you recommend doing this at all?

Is there a proper technique to do this?


a)"iframes" leave "scrollbars". And other problems maybe?
b)If we do use "Ajax", the content would not be available to web bots, or even my custom Google search bar, either. Right?
Quote:
Search engines cannot read text loaded with AJAX.
If it were accessible, It would display much differently when loaded in to the content div compared to when it was loaded into the browser window by a Google custom search bar without the content div containing it.

c)The content is not accessible by JavaScript, because the files are on the server, not the user side.

Do you recommend not doing the content div loading separately at all?

Thanks.
matt w is offline
Reply With Quote
View Public Profile Visit matt w's homepage!
 
Old 12-09-2010, 05:59 AM Re: change content of the content div onclick, without reloading the whole page?
CSM
CSM's Avatar
Front-End Developer

Posts: 297
Name: Michael Pehl
Location: Palma de Mallorca
Trades: 0
Use AJAX.

The CSS stuff that chrishurst showed us is only able to display content that is already in the page itself.

Quote:
Let me back up a moment. I am talking about loading images, links, text, whole pages into the content div.
Content from the same domain? Then it is not a big problem with the readability for bots.

I did that stuff several times myself - with a little trick, jQuery FTW
__________________
Chief Web Officer / Front-End Developer / System Engineer

Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
CSM is offline
Reply With Quote
View Public Profile Visit CSM's homepage!
 
Reply     « Reply to change content of the content div onclick, without reloading the whole page?
 

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.71735 seconds with 12 queries