Advanced Search

Results 1 to 9 of 9

Thread: iFrame New Window On Click

  1. #1
    Join Date
    May 2005
    Posts
    30
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question iFrame New Window On Click

    1) Script Title: iFrame New Window On Click

    2) Script URL (on DD): o http://www.dynamicdrive.com/dynamici...ndomiframe.htm

    3) Describe problem: I want to access the URL of the linked page (sub page) rather than the home page. One possibility is to always open a new window when you click on a page (the home page) in the frame. Can this be done?

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    28,690
    Thanks
    43
    Thanked 3,129 Times in 3,095 Posts
    Blog Entries
    12

    Default

    Your question isn't clear to me. I can tell you that using the target attribute with a link will open it in the desired manner, ex:

    HTML Code:
    <a href="whatever.htm" target="_blank">Whatever</a>
    will open in a new window. Using "_self" will open in the same window or frame (if the link is in a frame) and using "_top" will open in the same window, breaking out of frames (if any).
    - John
    ________________________

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

  3. #3
    Join Date
    May 2005
    Posts
    30
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I'll try to provide a better explanation. Here is a typical page on my Pingxit site: http://www.pingxit.com/cars.htm. If you click on the "VIEW" button at the bottom of the page, the original viewed page opens full screen. One can now copy the URL and save to Favorites etc.

    If however, you click on a link on the original viewed page and go to a sub page, and now click the VIEW button, you don't open the viewed (sub) page, but rather the original (home) page. I would like to open the sub page, not the original page.

    Here is the existing VIEW button code:

    <input type="image" src="button7.jpg" onclick="window.location.href=document.all? document.all.dynstuff.src: document.getElementById('dynstuff').src;" name="I3" width="225" height="25">

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    28,690
    Thanks
    43
    Thanked 3,129 Times in 3,095 Posts
    Blog Entries
    12

    Default

    You can't to do that using javascript and HTML alone due to security restrictions in all modern browsers prohibiting the cross domain sharing of information about frames and iframes. If it were not, this is how you would do it. First, you would give the iframe a name:

    Code:
    document.write('<iframe name="dynframe" id="dynstuff" src="" '+iframeprops+'></iframe>')
    You would have to make sure that name isn't used by anything else on the page. Next, you would modify your call for your image button:

    Code:
    onclick="window.location.href=window.frames['dynframe'].location.href;"
    But, as I say, this will be a security violation and therefore prohibited. There may be some type of server side work around to the violation but, that is beyond the scope of my knowledge and would depend upon what (if any) server side languages you have available to you.
    - John
    ________________________

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

  5. #5
    Join Date
    May 2005
    Posts
    30
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    John,

    Well...I don't want to do anything that is illegal, but it's hard to understand the difference between displaying the home page of a site vs. a sub-page.

    I am certain the sites/companies themselves will be delighted to be included in our database however they are displayed.

    You mentioned previously that you were working on a different backup code. Any progress?

    Any reason you haven't responded to my emails?

    Ry

  6. #6
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    28,690
    Thanks
    43
    Thanked 3,129 Times in 3,095 Posts
    Blog Entries
    12

    Default

    It's not a question of the law. It is the way security is set up in modern browsers. As with most technological fixes on human behavior, this really only keeps the honest people from doing interesting things while doing nothing to deter criminals who, in the end, will find another scam and/or a way around the tech fix. The main reason for this security 'feature' is to prevent phishing, just read the news and you will see how successful it has been at stopping the practice.

    As for my email, are you on my buddy list? Just kidding but, I get so many DD related emails that I have a filter for them. I usually come here to the forums first though.

    I'm not sure I was that committed to a back button for this script, if that is what you are referring to.
    - John
    ________________________

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

  7. #7
    Join Date
    May 2005
    Posts
    30
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    John,

    In general, my email referenced the need to take the next step with Pingxit and turn it into a database driven site. It seems to me this is the only way to solve the problems of setting up a proper Favorites function, Ratings, etc. - see: http://www.pingxit.com/test6.htm for a possible design of what I'm looking for.

    I had enquired as to whether you or one of your associates did consulting in this area.

    Ry

  8. #8
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    28,690
    Thanks
    43
    Thanked 3,129 Times in 3,095 Posts
    Blog Entries
    12

    Default

    Quote Originally Posted by rysmith View Post
    I had enquired as to whether you or one of your associates did consulting in this area.
    Personally, no - and I have no associates as yet. I'd suggest shopping your project here:

    http://www.rentacoder.com/RentACoder/default.asp

    or on similar sites. One thing I might consider is acting as a project coordinator and/or oversight if you end up requiring multiple coders. I am not in the business of finding coders though.

    One bit of free advice that I think I mentioned before is that your iframe does not appear in Opera. This was a good move at the time that the code for it was originally written but, no longer applies to that browser. So, it should be changed at some point in the development process.
    - John
    ________________________

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

  9. #9
    Join Date
    May 2005
    Posts
    30
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    John,

    Thanks for the input. I have used RentACoder in the past but I need to define a little better exactly what is needed for this project. I try to model everything to the extent I can.

    I'll keep the Opera problem in mind and I'll keep in mind your project coordinator thought.

    Ry

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
  •