Welcome to TalkGraphics.com
Results 1 to 7 of 7
  1. #1
    Join Date
    Apr 2009
    Location
    Jacksonville, Florida, USA
    Posts
    47

    Default Insert Javascript On Every Page

    I am creating a new site in XWD6 with multiple linked pages. Each page calls the same javascript function in the header area of the page (and also references a separate .js file). Is there any way to avoid having to place the same javascript script in the placeholder of every page - and the same file reference in the head area?

  2. #2
    Join Date
    Aug 2007
    Location
    Maghull UK
    Posts
    6,202

    Default Re: Insert Javascript On Every Page

    Select the (named <head>) placeholder then Arrange>>Repeat on all pages
    JOHN -XaReg (FB) XaReg (DB - ignore prompt to register)
    Windows 10 [Anniversary] pro Intel Pentium CPU G630 @ 2.70Ghz RAM: 4 GB; 64-bit x64

  3. #3
    Join Date
    Apr 2009
    Location
    Jacksonville, Florida, USA
    Posts
    47

    Default Re: Insert Javascript On Every Page

    neodist, Thanks for the reply, but I'm not sure I understand what you mean by the "(named <head>)" placeholder. Please elaborate a little.

  4. #4
    Join Date
    Aug 2007
    Location
    Maghull UK
    Posts
    6,202

    Default Re: Insert Javascript On Every Page

    Sorry Enter the head code into the web properties dialogue [remembering to press 'Apply']. Name the placeholder [right-click and you'll see the name option] as in the attachment. This goes on the grey area
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	head_code.jpg 
Views:	212 
Size:	57.7 KB 
ID:	77813  
    JOHN -XaReg (FB) XaReg (DB - ignore prompt to register)
    Windows 10 [Anniversary] pro Intel Pentium CPU G630 @ 2.70Ghz RAM: 4 GB; 64-bit x64

  5. #5
    Join Date
    Aug 2000
    Location
    Placitas, New Mexico, USA
    Posts
    41,502

    Default Re: Insert Javascript On Every Page

    hardot

    Create a rectangle, any size. Select the rectangle then select the small yellow tag icon on the Infobar. Name the rectangle <HEAD>. Press Add then Close.

    Select the rectangle then open the Website Properties > Placeholder section and paste your text in the Replace with HTML Code text entry area. Press Apply.

    This will place the js code in your exported HTML document in the <HEAD> section of the document. The rectangle now becomes a "placeholder" and you can place it off to the side of the page in the pasteboard area.

    If the code needs to be inserted in the <BODY> section then there is no need to name the placeholder rectangle.

    After you have set up your placeholder or placeholders, then select the placeholder or placeholders and from the Arrange menu, select Repeat on All Pages. This places the placeholder(s) on all the pages in your website.

  6. #6
    Join Date
    Apr 2009
    Location
    Jacksonville, Florida, USA
    Posts
    47

    Default Re: Insert Javascript On Every Page

    Thanks John, Gary. This process of using the placeholder in "empty" rectangles opens up a whole new world of expanding XWD's functionality for me.

  7. #7
    Join Date
    Aug 2000
    Location
    Placitas, New Mexico, USA
    Posts
    41,502

    Default Re: Insert Javascript On Every Page

    Exactly.

 

 

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
  •