Webmaster Forum

Go Back   Webmaster Forum > Web Development > Coding Forum

Coding Forum Problems with your code? Discuss coding issues, including JavaScript, PHP & MySQL, HTML & CSS, Flash & ActionScript, and more.


Reply
 
LinkBack Thread Tools Display Modes
Share |
  #1 (permalink)  
Old 01-27-2012, 12:16 AM
HTMLBasicTutor's Avatar
Administrator
 
Join Date: 10-29-07
Location: British Columbia, Canada
Posts: 20,243
iTrader: 5 / 100%
Switch Content Script

The problem:
Want to "expose" more stuff when the user clicks View All. Like on a shopping site when there are more than the hard coded say 20 items shown. But this is not a database driven site.

Want to save on download time on initial visit to page.

Solutions I found:
Switch Content Script at DynamicDrive. Scroll down to the Using Ajax to specify remote content for certain headers section.

This one looks easier: Cut & Paste Ajax Page Fetcher

The only thing with using Ajax is that last time I tried this for something similar it didn't pickup the CSS.


Anyone have a better solution to suggest?
__________________

HTML Basic Tutor - Learn how to code for better SEO
Basic Computer Information - Computer & internet basics for website owners

SEO troubleshooting and review services available. - Pm me.

Last edited by HTMLBasicTutor; 01-27-2012 at 12:32 AM.
 
Reply With Quote
  #2 (permalink)  
Old 01-27-2012, 05:44 AM
ScriptMan's Avatar
Super Moderator
 
Join Date: 02-10-07
Location: Central Kentucky
Posts: 11,813
iTrader: 4 / 100%
No database. Is it a PHP based site?

A long time ago I used a switch statement in conjunction with a rand() call to rotate a serious of page includes in a block on the index page of the site. I'm pretty sure I still have the code somewhere on this hard drive. That might be tweakable to show any of X numbers of pages showing Y amount of different items.

Each page would have to be hand coded if you have no DB and just sit there in a cache file.
__________________
SEO does not mean Spam Everywhere Online
Scriptman's Playhouse || Ramblings from an old man
 
Reply With Quote
  #3 (permalink)  
Old 01-27-2012, 09:37 AM
HTMLBasicTutor's Avatar
Administrator
 
Join Date: 10-29-07
Location: British Columbia, Canada
Posts: 20,243
iTrader: 5 / 100%
Just regular HTML site. I could put instructions in the .htaccess to process PHP.

I could put "the rest" in a hidden div that is exposed when the user clicks View All but that defeats the aim of keeping the download time down that's why I was looking for something that would insert on demand.

My other thought was: On most sites when they do this the page refreshes and the user has to start from the top again. I was trying to avoid that so they could continue from where they left off.
__________________

HTML Basic Tutor - Learn how to code for better SEO
Basic Computer Information - Computer & internet basics for website owners

SEO troubleshooting and review services available. - Pm me.
 
Reply With Quote
  #4 (permalink)  
Old 01-27-2012, 10:05 AM
ScriptMan's Avatar
Super Moderator
 
Join Date: 02-10-07
Location: Central Kentucky
Posts: 11,813
iTrader: 4 / 100%
How many total items are we talking about per page load? Is is image intensive?

At the moment a pop up like we do here for the extra smileys is the best I can come up with cause everything you said above is true. The hidden div does make for a clean looking page but saves no time or bandwidth.
__________________
SEO does not mean Spam Everywhere Online
Scriptman's Playhouse || Ramblings from an old man
 
Reply With Quote
  #5 (permalink)  
Old 01-27-2012, 10:30 AM
HTMLBasicTutor's Avatar
Administrator
 
Join Date: 10-29-07
Location: British Columbia, Canada
Posts: 20,243
iTrader: 5 / 100%
One section has about 40 items right now.

The look that is wanted is:
Image
Price
Link to more info
Maybe Buy Now button (they haven't decided)

x 4 divs wide

20 items initially

Thought of something else:
onclick,
write PHP include instruction and insert a PHP include with the rest.
__________________

HTML Basic Tutor - Learn how to code for better SEO
Basic Computer Information - Computer & internet basics for website owners

SEO troubleshooting and review services available. - Pm me.
 
Reply With Quote
  #6 (permalink)  
Old 01-27-2012, 12:25 PM
ScriptMan's Avatar
Super Moderator
 
Join Date: 02-10-07
Location: Central Kentucky
Posts: 11,813
iTrader: 4 / 100%
Won't that still refresh the whole page? It's sounds like a good solution for a no database site.

I would encourage an add to cart button in lieu of BIN or heck do both if they think they want that look. Add buttons are reputed to gather higher cart totals.
__________________
SEO does not mean Spam Everywhere Online
Scriptman's Playhouse || Ramblings from an old man
 
Reply With Quote
  #7 (permalink)  
Old 01-27-2012, 08:23 PM
RiptideTempora's Avatar
Contributing Member
Latest Blog:
None

 
Join Date: 11-30-11
Location: Orlando, FL
Posts: 235
iTrader: 0 / 0%
Code:
function showAll() { $.post("/listAll.html", function(data) { $("#targetDiv").html(data); }); }
OR
Code:
var globalFlag = 0; function showAll() { $.post("/listMore.html", function(data) { if(globalFlag == 0) { $("#targetDiv").append(data); globalFlag = 1; } }); }
Both codes are jQuery.

If you want to get really creative, you can just store everything in one file and separate it with a string you're unlikely to encounter in HTML and do this:
Code:
var globalFlag = 0; function showAll() { $.post("/listMore.html", function(data) { if(globalFlag == 0) { temp = data.split(String.charCodeAt(126)); // Find a character you'll never use in your actual document for this purpose $("#targetDiv").append(temp[0]); $("#targetDiv2").append(temp[1]); $("#targetDiv3").append(temp[2]); globalFlag = 1; } }); }
__________________
This Link Will Self-Destruct
Keenotes - A place for sharp minds

Last edited by RiptideTempora; 01-27-2012 at 08:33 PM.
 
Reply With Quote
  #8 (permalink)  
Old 01-27-2012, 09:19 PM
HTMLBasicTutor's Avatar
Administrator
 
Join Date: 10-29-07
Location: British Columbia, Canada
Posts: 20,243
iTrader: 5 / 100%
Thanks RiptideTempora. I have to think about this and how to do on a case by case basis.
__________________

HTML Basic Tutor - Learn how to code for better SEO
Basic Computer Information - Computer & internet basics for website owners

SEO troubleshooting and review services available. - Pm me.
 
Reply With Quote
Go Back   Webmaster Forum > Web Development > Coding Forum

Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Translating your content into different laguages without script j11t Web Design Lobby 0 06-18-2008 10:49 AM
Need free content script midnight_focus Web Design Lobby 3 04-27-2008 02:24 PM
Do you know script for stats content management? basketmen Web Design Lobby 2 03-18-2008 11:40 AM
content retrieval script RonHollingsworth Coding Forum 5 07-26-2006 10:12 AM


V7N Network
Get exposure! V7N I Love Photography V7N SEO Blog V7N Directory


All times are GMT -7. The time now is 04:47 AM.
Powered by vBulletin
Copyright 2000-2014 Jelsoft Enterprises Limited.
Copyright © 2003 - 2014 Escalate Media




Search Engine Optimization by vBSEO 3.6.0 RC 2 ©2011, Crawlability, Inc.