<script async src="https://cdn.ampproject.org/v0/amp-lightbox-0.1.js"></script>
I am using this tag in magento2 layout default.xml file and using <amp-lightbox>. But in google search console getting the error
Custom JavaScript is not allowed.
It seems you're missing the custom-element attribute on your <script>.
Try using this:
<script async custom-element="amp-lightbox" src="https://cdn.ampproject.org/v0/amp-lightbox-0.1.js"></script>
Related
I've a problem with my website, the layout load properly (and CSS) but no JS and page in yield.
I've copy paste the layout of my other website, inclued tje JS and CSS file, I do not understand why it does not work while on other sites it's good..
Code for include the JS and CSS file: <script src="{{url('js/jquery.min.js')}}"></script>
As you can see, the page is empty, and this is not normal.
Image of error:
Ahh... ok.
I've forget to DL From:: into my project. Sorry
I had the same problem when I was creating a recent Laravel project however mine was narrowed down too 2 problems. 1 being the JS had an error and 2nd was the way I called it.
I fixed it by doing the following:
<script type="text/javascript" src="{!! asset('js/jquery.min.js') !!}"></script>
I'm having an issue with the Add to Cart Button on my website. The error I am receiving is:
Uncaught TypeError: Cannot read property 'submit' of undefined
The link to the preview of this site is:
http://southeastsupfix.safetechhosting.co.uk/index.php/cp5000-429.html
Here is the full list of errors that I get:
I am sensing a possible JQuery conflict but I can't quite see where.
In terms of the inclusion of files, I had added these in the head.phtml
<script type="text/javascript" src="/js/JQ/jquery-1.2.6.js"></script>
<script type="text/javascript" src="/js/JQ/prototype.js"></script>
I have also tried the latest version of JQuery but I get the same issues.
If anyone has experienced this before I'd be great if I could get some information.
Replace $ in your jquery code with 'jQuery' like $('body') to jQuery('body')
I want to add a pinterest widget to my site. I've customized it and added the code:
<a data-pin-do="embedUser" href="http://www.pinterest.com/bigrockpremiuml/"></a>
<!-- Please call pinit.js only once per page -->
<script type="text/javascript" async defer src="https://assets.pinterest.com/js/pinit.js"></script>
When I then test it in my browser, it cannot find a js file referenced in that script which is this
http://assets.pinterest.com/js/pinit_main.js
The error I get in the console is because it cannot find the file.
file://assets.pinterest.com/js/pinit_main.js
So the browser is looking for the file in my local storage instead of the link....help
is there any reason for something to work in page inspector and not in real debug mode?
In particular I'm using fullcalendar.min.js (JQuery plugin) in some tab content and I see it very well in page inspector but when debug the calander is not shown..
in header:
<link rel="stylesheet" href="./../../Content/fullcalendar.css" type="text/css" media="all" />
<script src="./../../Scripts/js/fullcalendar.min.js"></script>
in body:
<section class="tab events-tab">
<section class="events-tab-inner">
<div id="calendar"></div>
</section>
</section>
in console of the web page loading I have the below errors (I'm not sure they are directly related to my calendar thing):
GET http://localhost:3516/SITE/css/images/star-off.png 404 (Not Found) jquery.min.js:2
Invalid App Id: Must be a number or numeric string representing the application id. all.js:56
event.returnValue is deprecated. Please use the standard event.preventDefault() instead. jquery.min.js:3
FB.getLoginStatus() called before calling FB.init(). all.js:56
GET http://localhost:3516/SITE/css/images/star-off.png 404 (Not Found) jquery.min.js:2
Based on your console output that you've included above, it seems that there are a few errors. Not sure why they would work in page inspector and not debug though. It seems like it should be breaking everywhere. Let's approach each error one by one:
1. Invalid Image Paths
It appears that you may be using jQuery UI for some features within your code. The jQuery UI suite contains images located in the /images directory when you download the .zip file that the CSS references as background-images. These images are expected to be nested on directory in from the location of the CSS file. For example,
[CSS Directory]
-> jquery-ui.min.css
[images]
-> star-off.png
-> ...
-> etc.
The only way to change this structure is to modify the relative urls within the minified jQuery UI CSS file.
2. Facebook JavaScript SDK error
I have never personally used the Facebook JavaScript SDK. However, that is what it appears you are using. From the error it sounds like you never initialize the Facebook object via FB.init() before you call FB.getLoginStatus(). Try this:
<script type="text/javascript">
/* Locate your FB.getLoginStatus() call and place FB.init() before it */
FB.init();
FB.getLoginStatus();
</script>
Other than that, you may need to refer to their documentation for how to properly initialize the FB object for use.
Hope this helps. Good luck and happy coding! :)
i am using script tag in my MVC view and my src for Script tag is "http://ajax.microsoft.com/ajax/jquery/jquery-1.4.2.min.js".
the issue iam facing is html buttons are not working/postingback.
If i remove script tag,everything works fine.
whts the actuals problem with my code.?
there could be number of issues, the script tag you are refereing to includes the jquery library from the CDN. One possibility could be that there is some javascript code in the view that is disabling your buttons you can verify by doing the following
1) keep the script tag (jQuery) included in the view
2) in the script section of your view (if you have else create one like)
<script>
$(function(){
$(":button").removeAttr("disabled");
});
</script>
3) so your final code will look like
<script src="http://ajax.microsoft.com/ajax/jquery/jquery-1.4.2.min.js"></script>
<script>
$(function(){
$(":button").removeAttr("disabled");
});
</script>
check now if it works... if it works then it means that you have some code that is disabling the buttons and upon removal of jquery library js error would have occured that why it seems to work...