How to Embed Javascript in Layout.Master

A place for discussion about skinning and design. Before posting questions here you should review the documentation about creating skins.

This thread is closed to new posts. You must sign in to post in the forums.
11/25/2009 5:25:20 AM
Gravatar
Total Posts 70

How to Embed Javascript in Layout.Master

Hello Joe,

We successfully uploaded our mojoportal site all work fine but our javascript files .

the javascript files was embeded in Layout.Master this way.

<script language="javascript" src="/ClientScript/script.js" type="text/javascript"></script>. It work on our local setup but to our test site it did not work.

Is there another way on how we can embed javascript file that it will work.

Your reply will be greatly appreciated.

Thank you.

 

 

11/25/2009 9:17:29 AM
Gravatar
Total Posts 2239

Re: How to Embed Javascript in Layout.Master

Hello,

That should work and is the proper method for including javascript in your site. I would check the path of the script to make sure it is correct. You can do this by typing http://yoursiteurl.com/ClientScript/script.js in your browser location bar. If the browser can't find the script, make sure it is in the ClientScript directory. Finally, I would also put the <script> tag at the bottom of the <head> section in layout.master.

HTH,
Joe D.

11/25/2009 9:03:16 PM
Gravatar
Total Posts 70

Re: How to Embed Javascript in Layout.Master

Hello Joe,

Already check the path of my file by typing it on the browser and it displays the file which means I'm on the correct path.

When you said:

       Finally, I would also put the <script> tag at the bottom of the <head> section in layout.master.

You mean that my scripts should be placed inside the <head></head> tag?

Your help is greatly appreciated.

 

Thank you very much.

11/27/2009 1:53:19 PM
Gravatar
Total Posts 2239

Re: How to Embed Javascript in Layout.Master

Yes, your scripts should be placed inside the <head> tag but they normally will work outside of the <head> tag. If it worked in your test environment, it should work on your production site.

5/17/2011 10:36:04 AM
Gravatar
Total Posts 2

Re: How to Embed Javascript in Layout.Master

Hi, I'm new using MojoPortal. I want to modify the layout.master and include some javascript. I put the script at the botoom of the <head> section but nothing happen. I'm modifying the layout.master in the folder App_MasterPages...Is this correct?

Thanks in advanced

5/17/2011 11:09:51 AM
Gravatar
Total Posts 1203
Proud member of the mojoPortal team

Help support mojoPortal!
Add-on modules

Re: How to Embed Javascript in Layout.Master

You should read through the skinning overview document. You'll need to modify the layout.master in the directory /Data/sites/[SiteID]/skins/[Skin name]

Jamie

5/17/2011 3:21:39 PM
Gravatar
Total Posts 2

Re: How to Embed Javascript in Layout.Master

Hi, Jamie

Thank you for your help. Problem solved.

You must sign in to post in the forums. This thread is closed to new posts.