Chrome shows html too late [closed] - javascript

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.
Closed 9 years ago.
Improve this question
I have made a slider, based on flexslider. The slider is working perfectly, except for Chrome. All latest versions of FF, IE, Safari work fine, but Chrome isn't. Normally it's the other-way around...
See my slider here: http://test.postitief.nl/slider/.
What you will see (I hope) is that the with transparency including the text is show after the animation is done. It doesn't slide with the animation. All other browser slide this text without a problem and immediately show it.
Added video's
Video of how the slider should work (IE10): link
Video of how the slider works in Chrome (v29): link
Added code
code http://jsfiddle.net/zwFhe/

Edit
I found an equal problem
Solution: useCSS: "false"
Tip
You have
<script type="text/javascript" src="js/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="js/functions.js"></script>
<script type="text/javascript" src="js/jquery.flexslider-min.js"></script>
But I think you need to include the flexslider js file before your function like this:
<script type="text/javascript" src="js/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="js/jquery.flexslider-min.js"></script>
<script type="text/javascript" src="js/functions.js"></script>

Related

Can`t load jQuery library [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 3 years ago.
Improve this question
I'm trying to load jQuery library following videos but it does not work. When I'm trying to load some jQuery function, it writes that jquery is not defined. I also tried CDN.
<title>
GRID
</title>
<link rel="stylesheet" href="grid.css">
<link href="https://fonts.googleapis.com/css?
family=Ubuntu&display=swap" rel="stylesheet">
<script src="jquery-2.1.1.min.js"></script>
<script src="script.js"></script>
</head>```
You need to put jquery-2.1.1.min.js file into same location where your quoted file is if we are talking about local purposes.
If your prefer to download it each time, you can use for example Google Hosted Libraries in following way:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
Like so <script src="jquery-2.1.1.min.js"></script>, jquery have to be in the root of your domain, like your script.js.
If you want CDN, use:
<script rel="prefetch" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js></script>
Or official jQuery CDN:
<script
rel="prefetch"
src="https://code.jquery.com/jquery-2.1.1.min.js"
integrity="sha256-h0cGsrExGgcZtSZ/fRz4AwV+Nn6Urh/3v3jFRQ0w9dQ="
crossorigin="anonymous">
</script>

How can I use noscript tag? [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 8 years ago.
Improve this question
When user login with Internet Explorer and user's javascript setting is disabled, I want to show an alert to user. I've tried to use <noscript> tags. I've changed my javascript settings (enabled to disabled) for test it but when I try it, nothing displays. How can I do it? Here are my codes below;
<script>
document.write("Hello World!")
</script>
<noscript>Sorry, your browser does not support JavaScript!</noscript>
<p>A browser without support for JavaScript will show the text inside the noscript element.</p>
This is a nice one. It's because your example its so minimal. The browser automatically wraps the <script> and <noscript> tags in <head>, which means that while the JS executes and writes "Hello world", the <noscript> tag gets hidden, because it's in the <head>.
If you manually place them in the <body> it works fine:
<html><head></head>
<body>
<script>
document.write("Hello World!")
</script>
<noscript>Sorry, your browser does not support JavaScript!</noscript>
<p>A browser without support for JavaScript will show the text inside the noscript element.</p>
</body>
</html>

White Flash on First Page Load: Can this be "fixed?" [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 2 years ago.
Improve this question
I've noticed that on the first load of some of the pages on my site, there's a quick white flash.
It doesn't seem to do this once the page content has been cached, but it's annoying during the first loads.
I tried styling all of the <html> tags black, but that doesn't seem to solve the issue. Could it be the scripts on some of my pages? (i.e. maybe analytics)
Is there anything I could do to remedy this problem?
Update: The site can be viewed here. Some pages have Javascript, but others do not, and it seems that's irrelevant, based on the results I've experienced.
OK, so it looks like this might be related to your script tag in the <head/>. Try pushing that down to just before the closing </body> tag. The document can't render until that script has completely run.
See rule 6
However, one of the other resource you're waiting on sometimes is 'home.css'. That may even be more of a problem. It's a bit of a hack, but you could try setting your background to black before even that css using an inline <style/> tag.
Try structuring the page in this order (notice the <style/>) tag;
<!doctype html>
<html>
<head>
<style>
html { background-color: black; }
</style>
...
<link href="home.css" rel="stylesheet" type="text/css">
...
</head>
<body>
...
<div id="footer">
<span class="footer_text">Copyright © 2013 Casey Kidd Music.<br />All Rights Reserved.</span>
</div>
</div>
<script>
(function(
...
'pageview');
</script>
</body>
</html>
It's possible you may still get a small flicker of white between pages, before the HTML has loaded, but this window would be pretty small now.

Javascript file is not listing in fire bug [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I have a asp.net application.I added a script file in my master page.
<script type="text/javascript"
src="<%= Page.ResolveClientUrl("~/Scripts/Notification.js")%>"></script>
But am not able to find the same on my fire bug. I had checked with another machine also.
Any one have any idea about the strange issue? If i went wrong any where please do help me to sort it out.
The script reference just above the
<script type="text/javascript" src="<%= Page.ResolveClientUrl("~/Scripts/Notification.js")%>"></script>
Missing close tag.But still am wondering why no error was not thrown in browser while loading.
<script type="text/javascript" src="<%= Page.ResolveClientUrl("~/Scripts/Custom/Publish/Global.js")%>"</script>
Now changed in to
<script type="text/javascript" src="<%= Page.ResolveClientUrl("~/Scripts/Custom/Publish/Global.js")%>"></script>
Now am able to get the script on my fire bug.
> is missing Resolved.

Why isnt jQuery appearing in my page [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I have my "good.html" and "jquery.js" file in a folder on desktop called "jquery2."
Here is my code
<!doctype html>
<head>
<meta charset="utf-8">
<script type="text/javascript" src="jquery.js"></script>
</head>
<body>
<script type="text/javascript">
$(document).ready(function(){
console.log('ready');
});
</script>
</body>
</html>
Your
<script type="text/javascript" src="jquery.js"></script>
is not referencing the file on your desktop.
In order to make this work, you should upload the files to a server.
You don't need a server but you do need to use a good path to the javascript file on your desktop, on windows like so:
<script type="text/javascript" src="C:\Users\username\Desktop\jquery2\jquery.js"></script>
works for me on windows 7 with chrome browser. console shows ready.
If I make the path bad, console shows "Uncaught ReferenceError: $ is not defined" followed by a red X box next to
GET file:///C:/Users/wrongusername/Desktop/jquery2/jquery.js
Its issue with your Javascript path... put on same folder of your code or
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.1/jquery.min.js"></script>
more info
Where do you include the jQuery library from? Google JSAPI? CDN?
<script type="text/javascript">
$(document).ready(function(){
alert('ready');
});
</script>

Categories

Resources