Solved

ASP 0138 errors

Posted on 2014-10-10
9
292 Views
Last Modified: 2014-10-10
Hi, Trying to get this script working in a Classic ASP page but getting ASP 0138 errors.

		<!--[if !IE]> -->

		<script type="text/javascript">
			window.jQuery || document.write("<script src='assets/js/jquery-2.0.3.min.js'>"+"<"+"/script>");
		</script>

		<!-- <![endif]-->

		<!--[if IE]>
<script type="text/javascript">
 window.jQuery || document.write("<script src='assets/js/jquery-1.10.2.min.js'>"+"<"+"/script>");
</script>
<![endif]-->

		<script type="text/javascript">
			if("ontouchend" in document) document.write("<script src='assets/js/jquery.mobile.custom.min.js'>"+"<"+"/script>");
		</script>

Open in new window

0
Comment
Question by:Gareth_Pointon
  • 4
  • 4
9 Comments
 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
ID: 40372964
The code you have shown would not produce that error.  What is the exact asp error, line number?  Can you provide your code sample (including asp code)

For reference  http://classicasp.aspfaq.com/general/why-do-i-get-asp-0138-errors.html
0
 

Author Comment

by:Gareth_Pointon
ID: 40372986
Hi,

I cannot make scenes of that.. I tried that but it didn't work.
script.rtf
0
 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
ID: 40373017
I should have explained it better. The link I gave you for that error explains you can't have a script run inside of a script.   That is just a clue.    I don't see any asp code in what you provided.  

An example is this bit of code.  

<script type="text/javascript">
			window.jQuery || document.write("<script src='assets/js/jquery-2.0.3.min.js'>"+"<"+"/script>");
		</script>

Open in new window

How come you are not just using
<script src='assets/js/jquery-2.0.3.min.js'>

Open in new window

If you want to detect jquery, I think you can do it like below instead.  
if (window.jQuery) {  
    // jQuery is loaded  
} else {
    // jQuery is not loaded
}

Open in new window



Also, probably unrelated but it looks like you have code for a templating engine but I don't see where you are loading anything like mustache.
<script type="text/javascript">
				try{ace.settings.check('navbar' , 'fixed')}catch(e){}
			</script>

Open in new window

0
 

Author Comment

by:Gareth_Pointon
ID: 40373057
Hi,

It was a template I brought online and yes I think thats what the developer was using on this dynamic paging.

However it also have basic HTML pages that you can then use in any coding type you like (so I'm told). I was staring to learn ASP.Net #C but don't have the time at the moment so wanted to take this template and use it for the current Classic ASP site.
0
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:Gareth_Pointon
ID: 40373300
Am I doing something completely wrong as just cannot get this to work.
0
 
LVL 32

Expert Comment

by:Big Monty
ID: 40373370
as a shot in the dark, try breaking up your end </script> tag a little more, instead of on the slash:

window.jQuery || document.write("<script src='assets/js/jquery-2.0.3.min.js'>"+"</sc"+"ript>");
0
 
LVL 52

Accepted Solution

by:
Scott Fell,  EE MVE earned 500 total points
ID: 40373382
This is all you need
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>


<!DOCTYPE html>
<html>
<head>
  <link href="css/style.css" rel="stylesheet" type="text/css" />
<script src="//code.jquery.com/jquery-2.1.1.min.js"></script>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body>

</body>
</html>

Open in new window

From there add your own style sheet(s) and js references.  In this sample, I am using the jquery cdn but you can load from your own server.

Then just add your template code.

Keep this
			<div class="navbar-container" id="navbar-container">
				<div class="navbar-header pull-left">
					<a href="#" class="navbar-brand">
						<small>
							<i class="icon-leaf"></i>
							Ace Admin
						</small>
					</a><!-- /.brand -->
				</div><!-- /.navbar-header -->

Open in new window

Change this type of code
 
<script type="text/javascript">
			if("ontouchend" in document) document.write("<script src='assets/js/jquery.mobile.custom.min.js'>"+"<"+"/script>");
		</script>
		<script src="assets/js/bootstrap.min.js"></script>
		<script src="assets/js/typeahead-bs2.min.js"></script>

Open in new window

to
 
<script type="text/javascript">
			<script src='assets/js/jquery.mobile.custom.min.js'></script>
		
		<script src="assets/js/bootstrap.min.js"></script>
		<script src="assets/js/typeahead-bs2.min.js"></script>

Open in new window

You can detect mobile browsers through jquery with http://detectmobilebrowsers.com/ or even better, just use bootstrap http://getbootstrap.com/ or foundation http://foundation.zurb.com/.  However, since you already have a template, that may just confuse the issue.  

You will just have to adjust your template for asp.  Think of it as straight html and just use your asp for dynamic content.
0
 

Author Closing Comment

by:Gareth_Pointon
ID: 40373402
Thanks.  It was the ' needed to be "

Thanks for the help.
0
 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
ID: 40373417
Glad it worked.

One note, that final code should have the top line taken out leaving only the calls to the js files.
<script src='assets/js/jquery.mobile.custom.min.js'></script>

<script src="assets/js/bootstrap.min.js"></script>
<script src="assets/js/typeahead-bs2.min.js"></script>

Open in new window

0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now