Results 1 to 8 of 8

Thread: Drop-Down Document Viewer II

  1. #1
    Join Date
    Jul 2010
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Drop-Down Document Viewer II

    1) Script Title: Can this be changed?
    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...pdownview2.htm

    3) Describe problem: I just found a script written by DynamicDrive guys, and it is exactly what I have been looking for a long time. Implementing it is a joy. Using it is a pleasure. Little problem: I can ONLY call URLs from outside my website.

    Can this be changed so the script can call .html files "from within" my own web site? Please, do not ignore me. I need this jewel.
    Last edited by GeeJay; 07-11-2010 at 07:55 PM.

  2. #2
    Join Date
    Oct 2009
    Posts
    845
    Thanks
    14
    Thanked 189 Times in 188 Posts

    Default

    Hi GeeJay. I just tried the script and it works fine on my site viewing a page on the same domain. I used an absolute path http://.......
    It is a nifty feature, but I wonder if it is legal to put other sites in an iframe like this. What do you think ?

  3. #3
    Join Date
    Jul 2010
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Thank you Azoomer !

    I appreciate your response, Azoomer. I exclusively use http:// URLs in the code. External URLs work, but the moment I point the code to .html docs within my web site, it does not work. In addition, at the very left bottom corner of the browser I can read "Done with errors." - [IE 8]

    The reason why I posted is because I do not know. I need the answer of a knowledgeable guy at DynamicDrive, hopefully. So, I cannot answer the question "What do you think?"

    Maybe, one of the guys who put together this wonderful piece can have a look at the code I am using. It is located at http://www.fountain-of-wisdom.com/index-2.html

    Thanks very much one more time.

  4. #4
    Join Date
    Oct 2009
    Posts
    845
    Thanks
    14
    Thanked 189 Times in 188 Posts

    Default

    I suggest you change this back to "external" as it is in the original code
    Code:
    document.getElementById("internal").src=inputurl
    else if (document.all&&displaymode==0)
    document.all.internal.src=inputurl
    Before it was referring to the id="external" which is the id of the iframe. There is no id called internal on your page, hence the error.
    Last edited by azoomer; 07-12-2010 at 12:32 AM.

  5. #5
    Join Date
    Jul 2010
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks so much for not giving up on me, Azoomer. I mean it.

    Changing the "internal" to "external" was my assumption that it MAY have to do with .html documents being within the domain. After unsuccessfully attempting the change, I immediately reverted the code back to the original code which is the one you sent me.

    I just cannot understand. Such a heck of an idea has to be abandoned. I concluded that there must be a reason why the developers provide the code with external URLs and they mention nothing about calling up .html docs within the same domain the code is being used on.

    Well... C'st La Vie as the French say. An entire Sunday without seeing the sun went down the drain just for the fun of it. Back to good, old... and reliable... HTML. I remain very thankful to the only guy that showed up to lend a hand. If you were a girl, I will kiss you. Thanks so much good guy !

  6. #6
    Join Date
    Oct 2009
    Posts
    845
    Thanks
    14
    Thanked 189 Times in 188 Posts

    Default

    glad i'm not a girl
    And by the way, i can't truly understand the logic in what you are writing in your last comment, just be sure to use the original script. That works. ( if it aint broken.....)
    Last edited by azoomer; 07-12-2010 at 01:37 AM.

  7. #7
    Join Date
    Jul 2010
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    The "kiss a girl" statement means that I am so thankful to you that I would be willing to show my appreciation with an act of affection. The last statement means that using the code as provided works with URLs pointing to "external URLs." When the code is used to point to "internal URLs" it does not work.

    A way to verify my statement is the browser itself saying "Done with error on page" even when I copied the entire code as provided. I wouldn't have spent an entire Sunday if the developers of the code would have said something like "This code is meant only for "external URLs" as the sample provided shows."

    I keep the kiss, and I remain thankful to you for your good will and intent in this unsolved matter.

  8. #8
    Join Date
    Oct 2009
    Posts
    845
    Thanks
    14
    Thanked 189 Times in 188 Posts

    Default

    GeeJay. Don't give up. the script actually works for the purpose you need. To show you what i mean I have made a demo page that you can see HERE.
    As you can see the framed pages are all on the same domain, as you would call internal. But the point I have been trying to make is that you should not put to much meaning in the words internal/ external. As long as you don't change the word external in the original script it will work, even when referring to a page on your own domain.

    Another example of the script working with pages on the same domain can be seen HERE, it is the first edition of the script on DD.

    The code I pasted into post #4 was not meant as something for you to use, it was a copy of the code you were already using on your page. I was trying to illustrate what the error was.

    I suggest you try again.

    This is the original code from dynamic drive. (Drop-down Document Viewer II)
    Code:
    <!--CHANGE LINKS BELOW TO YOUR OWN-->
    <a href="javascript:jumpto('http://www.cnn.com')">CNN.com</a> | 
    <a href="javascript:jumpto('http://www.msnbc.com')">MSNBC</a> | 
    <a href="javascript:jumpto('http://www.abcnews.com')">ABC News</a> | 
    <a href="javascript:jumpto('http://news.bbc.co.uk')">BBC UK News</a>
    
    <script language="javascript">
    <!--
    
    //Drop-down Document Viewer II-  Dynamic Drive (www.dynamicdrive.com)
    //For full source code, 100's more DHTML scripts, and TOS,
    //visit http://www.dynamicdrive.com
    
    //Specify display mode (0 or 1)
    //0 causes document to be displayed in an inline frame, while 1 in a new browser window
    var displaymode=0
    //if displaymode=0, configure inline frame attributes (ie: dimensions, intial document shown
    var iframecode='<iframe id="external" style="width:95%;height:400px" src="http://www.yahoo.com"></iframe>'
    
    /////NO NEED TO EDIT BELOW HERE////////////
    
    if (displaymode==0)
    document.write(iframecode)
    
    function jumpto(inputurl){
    if (document.getElementById&&displaymode==0)
    document.getElementById("external").src=inputurl
    else if (document.all&&displaymode==0)
    document.all.external.src=inputurl
    else{
    if (!window.win2||win2.closed)
    win2=window.open(inputurl)
    //else if win2 already exists
    else{
    win2.location=inputurl
    win2.focus()
    }
    }
    }
    //-->
    </script>
    If you use that and ONLY edit what I have highlighted in blue color, and nothing else, I am sure you will get it working quickly.
    Last edited by azoomer; 07-12-2010 at 07:39 AM.

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
  •