Results 1 to 6 of 6

Thread: Random Iframe Content

  1. #1
    Join Date
    Sep 2005
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Random Iframe Content

    I am using the Random Iframe content script. How can I get it to follow a particular order. When I go in and out of the page several times I will get the same content 3 out of 5 times.

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Random means random. Anything can happen and the odds are exactly the same for any given occurrence each time you 'roll the dice'. To get a random script to avoid repeats, I usually test that the new random generated value is different than the last used or current value. To do this onload though would require that a cookie be set to hold the old value and then evaluated on the next load. Another approach is to have so many unique possible outcomes that repetition becomes less likely. Say you currently have three possibles, repetition is highly likely. If you have 10 or 20, it becomes less likely.

    Warning: Please include a link to the DD script in question in your post. See this thread for the proper posting format for asking a question.
    PLEASE: Include the URL to your problematic webpage that you want help with.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Feb 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Me too

    I too am using the Random Iframe Content script http://www.dynamicdrive.com/dynamici...ndomiframe.htm

    Although there are 10 different 'panels' that are called randomly at http://www.computersplus.co.uk, I find that there is a lot of repetition. I do understand that this is normal but I would like to know how the script could be modified to read a cookie as mentioned previously.

    Unfortunately I know almost nothing about Javascript and DHTML but I do know how to cut and paste!

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Well, you have to realize that you are looking at this from the site owner's and/or designer's perspective. The user will see content that, as far as they know, is hard coded onto the page, if it changes sometimes and other times remains the same, it will make little difference to them. If they frequent the page, eventually they will see all (10 was it?) of the possible content portions. This script should not be relied upon as a means to display all of the items. If that is your object, there should be a separate page with all the items on it and a link provided to it from this page. In fact, you could make it so that clicking on any individual item in the iframe will load a page with all items on it with the one that was clicked on at or near the top with its expanded information, on this page, clicking on any item could collapse the previous item's details and expand the current item's. There are a number of scripts* here at DD (via the main DD site) and elsewhere that do this. If you need help locating them here at DD, let me know.

    Getting back to the repetition thing. Code could be added that will check to see if the content about to be displayed is the one that just was displayed but, this will require a cookie and cookie code to support it. Even if you were to institute such a scheme, it could happen that, if not an immediate repeat, you could have the one that showed the time before that. It is hardly worth it under the circumstances. To avoid this, the cookie and checking code could be made to list each content viewed and only show one of the ones not seen yet, until all have been viewed then clear itself and start over. However, if a user clears cookies or uses a different browser, this will not work. Also, if a user is interested in a particular item, it will become very unlikely that it will ever appear again for them within a reasonable period of time.

    I would recommend, as I said, leaving things as they are and providing a link to the full item listings on another page.

    *Search the main site for 'expandable content' and 'switch content'.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    Feb 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Thanks

    Thanks jscheuer1,
    You are absolutely right of course in that we are looking at it from a designer/owner perspective. I will leave it as is for now.

    The thing that concerns me is whether or not search engines would perceive this as 'changed content' since we are calling up iFrames containing html files themselves. Would we be better off using something like ajax or server side includes with content that changes with each day of the week etc.
    The thing is we want to keep the homepage 'fresh' without having to add stuff every day if you know what I mean.

  6. #6
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    I'm not up on the latest 'skinny' on search engines and what they supposedly like or dislike. As far as I know though, as long as the changing content is also available via a regular link, it will still be spidered and included. If your goal is to appear different each time to the search engine spiders, I don't think this script will not do that. Spiders, to the best of my knowledge, ignore javascript. Best, I would think, to have one page hard coded as the source of the iframe so the spiders (and non-javascript enabled browsers) will see that page. It could even be a page with all of the items on it.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •