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?
Re: Insert Javascript On Every Page
Select the (named <head>) placeholder then Arrange>>Repeat on all pages :)
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.
1 Attachment(s)
Re: Insert Javascript On Every Page
Sorry :o 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 :)
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.
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.
Re: Insert Javascript On Every Page