Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

JavaScript include not appearing in <HEAD> tag 1

Status
Not open for further replies.

nwruiz

Programmer
Jun 22, 2005
60
US
Hello. I have added the last two following lines of code to the <HEAD> tag inside my .aspx file. Here is the entire contents of the <HEAD> tag:

Code:
<HEAD>
		<title>SPAAcctInfo</title>
		<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
		<meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE">
		<meta content="JavaScript" name="vs_defaultClientScript">
		<meta content="[URL unfurl="true"]http://schemas.microsoft.com/intellisense/ie5"[/URL] name="vs_targetSchema">
		<LINK href="/EU_RSSelfServ/css/SelfServiceStyles.css" type="text/css" rel="stylesheet">
		<LINK href="/EU_RSSelfServ/css/movingImageStyle.css" type="text/css" rel="stylesheet">
		<script language="javascript" src="JScripts/moveSurveyImage.js" type="text/javascript"></script>
	</HEAD>

However, when I compile and test the code, the JavaScript and CSS file are not included. This is what the <HEAD> tag looks like when I view the source from IE:

Code:
<HEAD>
		<title id="title">myPPL Electric - Customer Services Online</title>
		<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
		<meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE">
		<meta content="JavaScript" name="vs_defaultClientScript">
		<meta content="[URL unfurl="true"]http://schemas.microsoft.com/intellisense/ie5"[/URL] name="vs_targetSchema">
		<LINK href="/EU_RSSelfServ/css/SelfServiceStyles.css" type="text/css" rel="stylesheet">
		<SCRIPT language="JavaScript" src="/EU_RSSelfServ/JScripts/ppleu_rsapp.js"></SCRIPT>
	</HEAD>

Does anyone have any idea why the JavaScript and CSS includes that I added do not show up, when the ones listed above it are? Thank you very much for your time.

Nick Ruiz
CO-OP Intern, PPL Electric Utilities
Webmaster, DealMerchant.net
 
Have you tried clearing your browser cache (or do you have any outputcache on your aspx pages)? The reason I ask, is that you appear to have a file from the generated HTML:
Code:
<SCRIPT language="JavaScript" src="/EU_RSSelfServ/JScripts/ppleu_rsapp.js"></SCRIPT>
Which isn't in the first code block (i.e. you aspx page). If it hasn;t been included then it can't be rendered to the browser, unless the browser is using a cached version of the page.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
I just tried clearing the cache on IE, but the same thing happens. I believe that the other .js file is inherited from a template. The website is structured that each page inherits a header from a template.

Thanks for your help, though. If you have any other ideas, please let me know.

Nick Ruiz
CO-OP Intern, PPL Electric Utilities
Webmaster, DealMerchant.net
 
There's no valid reason as to why they wouldn't be output so the only things I can think of that may influence them is:

1) Caching
2) Inheritance

You say you have ruled out #1 (I would just check to see if you have any OutputCache directives on any of the pages) so that only leaves #2. You mention that you are using templates, so it may be that somehow these are affecting what it written out as headers.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Looks like inheritance was the problem. There seems to be a .ascx file that serves as the master control for the website. Apparently, that <HEAD> file seems to be overwriting all of the others.

Nick Ruiz
CO-OP Intern, PPL Electric Utilities
Webmaster, DealMerchant.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top