?
Solved

ASP 0138 errors

Posted on 2014-10-10
9
Medium Priority
?
306 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
9 Comments
 
LVL 53

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 53

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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

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
 

Author Comment

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

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 53

Accepted Solution

by:
Scott Fell,  EE MVE earned 2000 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 53

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
In this blog, we’ll look at how improvements to Percona XtraDB Cluster improved IST performance.
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…
Suggested Courses

765 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