ASP 0138 errors

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

Gareth_PointonAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
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
Gareth_PointonAuthor Commented:
Hi,

I cannot make scenes of that.. I tried that but it didn't work.
script.rtf
0
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
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
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Gareth_PointonAuthor Commented:
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
Gareth_PointonAuthor Commented:
Am I doing something completely wrong as just cannot get this to work.
0
Big MontySenior Web Developer / CEO of ExchangeTree.org Commented:
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
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Gareth_PointonAuthor Commented:
Thanks.  It was the ' needed to be "

Thanks for the help.
0
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.