SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Zealot Narfotic's Avatar
    Join Date
    Aug 2003
    Location
    Antwerp, Flanders, BE , EU
    Posts
    166
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    page should redirect if not opened in iframe lightwindow

    Hi,

    I'm quite new at JS and I just started messing about with jQuery a bit.
    I was wondering if you guys could help me...

    I am using Jquery Superbox to open a page in an iframe in a lightwindow.
    My problem is that Google will index and link to them individually. If people land on them they don't get the menu and stuff...
    But they should redirect to my original page if you land on them. And there open the lightwindow and then load the requested page in the iframe.

    I allready found a script here that will redirect the pages and display them (if there would be an iframe in my page from the start). But I don't know how I can open the lightwindow first and then open the page in the iframe.

    I'll attach a zip with an example page of my code so you have something to mess around with... It's just this code, nothing else...
    Attached Files Attached Files

  2. #2
    SitePoint Zealot Narfotic's Avatar
    Join Date
    Aug 2003
    Location
    Antwerp, Flanders, BE , EU
    Posts
    166
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    apparently the zip needs approval, so you can also find it here on rapidshare:
    http://rapidshare.com/files/367754879/iframe.zip (5KB)

  3. #3
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,527
    Mentioned
    84 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by Narfotic View Post
    My problem is that Google will index and link to them individually. If people land on them they don't get the menu and stuff...
    But they should redirect to my original page if you land on them. And there open the lightwindow and then load the requested page in the iframe.
    Is that some kind of multi-page redirect technique that you're using?
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  4. #4
    SitePoint Zealot Narfotic's Avatar
    Join Date
    Aug 2003
    Location
    Antwerp, Flanders, BE , EU
    Posts
    166
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by pmw57 View Post
    Is that some kind of multi-page redirect technique that you're using?
    What do you mean exactly? I have one main page. My content (seperate pages) load in an iframe in a modal box.

    But these contentpages will show up individually in Google. This is not aproblem, but they should only be showed when in a modal box on my main page.

    So I need:
    1. a redirect to the main page
    2. open a modal box with an iFrame
    3. open the specific page in that iFrame.

  5. #5
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,527
    Mentioned
    84 Post(s)
    Tagged
    4 Thread(s)
    1. You can use location.href to redirect to a different location.

    2. I don't know much about modal boxes in native javascript, however, jQuery Dialog boxes support modal behaviour very well.
    Otherwise, you might just want to use an iframe element within the HTML code of the main page.

    3. To open a page in the iframe, you would first gain a reference to the iframe, then change its href property to the page you came from. You can use document.referrer to get that previous page.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  6. #6
    SitePoint Zealot Narfotic's Avatar
    Join Date
    Aug 2003
    Location
    Antwerp, Flanders, BE , EU
    Posts
    166
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have set up a modal box in jquery and a redirect in javascript. See the attached file above.

    My current script can open a modal box from a link in the main page. No prob.
    And it can also redirect from the detailpage to the mainpage if it's not loaded in an iframe. And then send the page url to an iframe to show it. No prob.

    Problem is... There is no iframe on the mainpage. Only in the modal box.

    I just need a way to first open the modal box and then display the page in the iframe of that modal box.


Tags for this Thread

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
  •