Results 1 to 5 of 5

Thread: Referencing JS on remote

  1. #1
    Join Date
    Oct 2005
    Posts
    63
    Thanks
    5
    Thanked 1 Time in 1 Post

    Question Referencing JS on remote

    1) Script Title: DHTML Widget window

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

    3) Describe problem: How can this script be referenced so that it may appear on multiple pages without adding the code to each page

    Should the js or the html be referenced?

    I have tried adding
    <script src="url of js...">
    </script>
    to additional pages without success

    Assistance appreciated
    thanks
    Last edited by dbldee; 08-12-2007 at 08:15 PM. Reason: additional info

  2. #2
    Join Date
    Aug 2004
    Posts
    9,878
    Thanks
    3
    Thanked 962 Times in 951 Posts
    Blog Entries
    15

    Default

    You would change the references to the .css and .js file so they're full URLs:

    Code:
    <link rel="stylesheet" href="http://www.mysite.com/windowfiles/dhtmlwindow.css" type="text/css" />
    
    <script type="text/javascript" src="http://www.mysite.com/windowfiles/dhtmlwindow.js">
    
    /***********************************************
    * DHTML Window Widget- &#169; Dynamic Drive (www.dynamicdrive.com)
    * This notice must stay intact for legal use.
    * Visit http://www.dynamicdrive.com/ for full source code
    ***********************************************/
    
    </script>
    The code in the BODY of your page needs to be manually added to each page depending on what type of DHTML window you're opening etc.

  3. #3
    Join Date
    Oct 2005
    Posts
    63
    Thanks
    5
    Thanked 1 Time in 1 Post

    Default

    I was hoping to avoid having to add the full code to each page, but rather have remotely reference the script perhaps from different servers

    <src="http://www.mydomain/script.js">.

    Remote scripting JS should be possible.

    Thanks

  4. #4
    Join Date
    Oct 2005
    Posts
    63
    Thanks
    5
    Thanked 1 Time in 1 Post

    Default

    I think I got this, easier that I thought

    Thanks a lot

    How could the window be modified to include some image or text links that change the contents?

    Another way of asking to move
    <a href="#" onclick="widget.moveTo('middle', 'middle'); return false">Center Window 3 here</a></li>
    from appearing on the html page to somewhere on the window.

    thanks
    Last edited by dbldee; 08-13-2007 at 04:22 PM. Reason: more info

  5. #5
    Join Date
    Aug 2004
    Posts
    9,878
    Thanks
    3
    Thanked 962 Times in 951 Posts
    Blog Entries
    15

    Default

    If you mean how to add links within the DHTML window that manipulates itself, such as move it, that's possible. Once you've initially opened a DHTML window, ie:

    Code:
    var googlewin=dhtmlwindow.open("googlebox", "iframe", "http://google.com", "Google Web site", "width=700px,height=450px,resize=1,scrolling=1,center=1", "recal")
    Inside the DHTML window, you can, for example, create a link that moves it by using the code parent.googlewin to reference itself from the main page:

    Code:
    <a href="#" onclick="parent.googlewin.moveTo('middle', 'middle'); return false">Center Window 3 here</a>
    Try searching the forums for this, as there has been a few past discussions on this.

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
  •