Advanced web page developers may wish to create custom Landing Pages in DemandCenter that feature external JavaScript. JavaScript can be added to your Landing Pages via two methods:linking to an external js file:
1) Linking to an external js file:
- Go to Assets > Explore Landing Pages.
- Create or Edit your Landing Page.
- Click the HTML button, in the WYSIWYG toolbar, to view your Landing Page Template in HTML mode.
- Locate the <head> tag at the beginning of the code.
- Insert the JavaScript into the document <head> by using the following syntax:
<head>
<script src="http://PATH-TO-JSFILE.js"></script>
</head>Note - In this example, PATH-TO-JSFILE.js represents the full URL to the external js file.
- To retain your changes, click either:
- Save: Overwrite the preexisting Landing Page with which you started, with your changes.
- Save As: Create a NEW Landing Page that includes your changes.
- After saving your work, you can review your changes on the LIVE web page by clicking on the View link, next to Landing Page URL, at the top of the screen. A new window in your browser will open, and you will be directed to the LIVE Landing Page.
2) Inserting the JavaScript directly into the Landing Page code:
- Go to Assets > Explore Landing Pages.
- Create or Edit your Landing Page.
- Click the HTML button, in the WYSIWYG toolbar, to view your Landing Page Template in HTML mode.
- Insert JavaScript into the code by using the following syntax:
<script language="javascript">Your JavaScript goes here</script>
- To retain your changes, click either:
- Save: Overwrite the preexisting Landing Page with which you started, with your changes.
- Save As: Create a NEW Landing Page that includes your changes.
- After saving your work, you can review your changes on the LIVE web page by clicking on the View link, next to Landing Page URL, at the top of the screen. A new window in your browser will open, and you will be directed to the LIVE Landing Page.
To learn how to add CSS to your eTrigue hosted Landing Page, click here.
To learn how to create a new DemandCenter Landing Page, click here.
To learn how to edit an existing DemandCenter Landing Page, click here.
To learn more about DemandCenter's WYSIWYG Landing Page Editor, click here.