I use symfony version 1.4.1
Source I want to realize
<script type="text/javascript" src="//code.jquery.com/jquery-1.12.1.min.js"></script>
I wrote view.yml(apps/masao/config/view.yml)
javascripts: [//code.jquery.com/jquery-1.12.1.min.js]
This is the result.
<script type="text/javascript" src="/masao//code.jquery.com/jquery-1.12.1.min.js"></script>
Since this site has both http andhttps possibilities, I want to write src = "// ..."
Related
I setup bootstrap files in public folder. Routes are as below:
<link rel="stylesheet" href="{{url('assets/css/bootstrap.min.css')}}">
<script type="text/javascript" src="{{url('assets/js/bootstrap.min.js')}}"></script>
<script type="text/javascript" src="{{url('assets/js/jquery.min.js')}}"></script>
<script type="text/javascript" src="{{url('assets/js/tether.min.js')}}"></script>
no problem with this. I can see connection to files when I check the source code. and also bootstrap fonts are active but, when I try to copy some examples from bootstrap website. It doesn't display properly. For example I copied navigation bar to my main.blade But it doesn't show up.
What is causing this? Any idea?
It s big screen but showing responsive hamburger icon?
You should add jquery before bootstrap min js file
<link rel="stylesheet" href="{{url('assets/css/bootstrap.min.css')}}">
<script type="text/javascript" src="{{url('assets/js/jquery.min.js')}}"></script>
<script type="text/javascript" src="{{url('assets/js/tether.min.js')}}"></script>
<script type="text/javascript" src="{{url('assets/js/bootstrap.min.js')}}"></script>
The order in which you add javascript in HTML page is important. In this case since bootstrap.min.js uses jquery.min.js jquery must be added first. So when bootstrap loads and looks for jquery it finds it.
But if one script does not depend on another then you can add them in any order.
So add jquery.min.js first then anything that uses jquery(like bootstrap) after it.
I have two scripts the first is script.js that uses quicksand.js and the second is plusslider.
When I use code like the following, the plusslider works but the script.js doesn't.
But, when I delete the plussslider call the script.js works fine.
How do I make them work at the same time?
This is my header.php:
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script language="javascript" type="text/javascript" src="<?php bloginfo('template_url'); ?>/js/jquery.quicksand.js"></script>
<script language="javascript" type="text/javascript" src="<?php bloginfo('template_url'); ?>/js/script.js"></script>
<script language="javascript" type="text/javascript" src="<?php bloginfo('template_url'); ?>/js/jquery.plusslider-min.js"></script>
<script language="javascript">
$(document).ready(function(){
$('#slider').plusSlider({
createPagination: false,
sliderEasing: 'easeInOutExpo',
fullWidth: true,
sliderType: 'slider'
});
});
</script>
<?php wp_head(); ?>
Check to see how the links appear when you do a view source in the browser. Copy the relevant ones and make sure their addresses load the files in the address-bar.
Also, don't use language="javascript" that was old-school 5 years ago and might throw the right browser with the wrong doctype.
But trust me. Always go to the HTML first, every time. Even if that doesn't help you this time.
Also making sure you're not doing something silly in script.js like overwriting the $ namespace.
Another possible issue. Are all your resource links https? By that I mean images, CSS, other JS files, the actual page you're loading, etc...
I'm getting the following warning message on my web page:
A script on this page may be busy, or it may have stopped responding. You can stop the script now, or you can continue to see if the script will complete.
Script: https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js
How I can resolve it?
I'm using the following scripts:
<script src="https://www.markettrendsignal.com/beta/js/script.js" type="text/javascript"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="https://www.markettrendsignal.com/beta/js/thickbox.js" type="text/javascript"></script>
<script src="https://www.markettrendsignal.com/beta/js/jquery.treeview.min.js" type="text/javascript"></script>
<script src="https://www.markettrendsignal.com/beta/js/jquery.tipTip.minified.js" type="text/javascript"></script>
<script type='text/javascript' src='https://www.markettrendsignal.com/beta/js/jquery.colorbox-min.js'></script>
probably need to see more of the page. you may have some kind of recursive javascript that is taking advantage of jQuery, so the root cause is not jQuery, but the other javascript that uses it...
I created an application using PHP, mysql, and jquery. It's working fine on my localhost,m however after uploading it to the server, everything works fine but jquery, I believe it's not reading it.
Using firebug, I get the following error when trying to read the .js file in the browser:
Uncaught syntax error: Unexpected
token.
Here's how i include my scripts:
<script type="text/javascript" src="js/jquery-1.6.1.min.js"></script>
<script type="text/javascript" src="js/autoresize.jquery.js"></script>
<script type="text/javascript" src="js/customSelect.jquery.js"></script>
<script type="text/javascript" src="js/jquery.form.js"></script>
<script type="text/javascript" src="js/jquery.validate.js"></script>
<script type="text/javascript" src="js/jquery.validate.password.js"></script>
I did check my files and they exist in /js/ . What could be wrong?
UPDATE
It is working when I read :
https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js
But it's not working when reading from server?
You are using relative path right now.
When you use relative path, all the requests will go to the path relative to your location.
For example, if you are on http://www.mysite.com/products/catalog.php, your browser will send the request to get the jQuery scripts from this location: http://www.mysite.com/products/js/ which certainly does not exists.
Try using the absolute path instead. In fact make a habit of!
Try the following:
<script type="text/javascript" src="/path/to/your/srcipt/jquery-1.6.1.min.js"></script>
<script type="text/javascript" src="/path/to/your/srcipt/autoresize.jquery.js"></script>
<script type="text/javascript" src="/path/to/your/srcipt/customSelect.jquery.js"></script>
<script type="text/javascript" src="/path/to/your/srcipt/jquery.form.js"></script>
<script type="text/javascript" src="/path/to/your/srcipt/jquery.validate.js"></script>
<script type="text/javascript" src="/path/to/your/srcipt/jquery.validate.password.js"></script>
Shoud be an HTTP GET request for these js file.
<script type="text/javascript" src="js/jquery-1.6.1.min.js"></script>
Sounds like it does not exist on the location. If you have nice urls implemented or file does not exist then it would not work, try using full path.
<script type="text/javascript" src="http://xyz.com/js/jquery-1.6.1.min.js"></script>
I have installed the TinyMce blog editor to my site. When the compose blog page loads a I get a pop up that has the yield sign and says "Developer Key Validation Failed" Anyone know what this is?
<script type="text/javascript" src="javascripts/jquery/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="http://www.cysticlife.org/javascripts/jquery/jquery.corners.min.js"></script>
<script type="text/javascript" src="plugins/tinymce/tiny_mce.js"></script>
<script type="text/javascript" src="javascripts/system/config.js"></script>
<script src="http://www.google.com/jsapi?key=YOUR_API_KEY"></script>
<script src="http://gdata-javascript-client.googlecode.com/svn/trunk/samples/blogger/blog_this/blog_this.js"></script>
<div id="blog_this"></div>
I think that's a Google Data API error message; if so it's unrelated to TinyMCE. Are you using any Google data in the same page? If so, check your API key.