I'm using Google Analyticator and my website is http://gestionalemagazzinoonline.it/
You can see the error in the javascript console.
I think that is the suspected file:
https://github.com/wp-plugins/google-analyticator/blob/master/google-analyticator.php
The problem is also if i disable the plugin, or if i change the source code i don't see the changes (maybe there's a cache?).
How can I fix?
Script tags are meant to write javascript in them, and not html.
You have a script block inside a script block. Remove that, and it will work all fine.
Related
I wanted to give a little background first, I was facing the below issue in SSR React using NextJS. In my <head> I have <script></script> tag in which I have multiple <script> tags nested containing minified JS code for Google Analytics, Adobe Analytics, etc. To debug the issue, I tried to break it up more and only including one JS code at a time in my outer <script> tag like only GA or only Adobe to see where it is breaking.
It works fine when I use <noscript> tag and inside it, I have multiple <script> tags containing minified JS for GA, AA, etc. But it breaks my purpose, as when page loads Google Tag Assistant does not catch the tags.
To my surprise, when I tried running below a simple JS code (PSB SS) in incognito mode (just to make sure plain browser profile without any extensions/plugins) I get the same error. Even if I try without incognito mode I get the same error for this simple JS code.
Uncaught SyntaxError: Unexpected token '<'
What is the issue here and why am I getting this error?
Java script belongs inside <script> tags, but <script> tags themselves are HTML, therefore they are not expected, and thats why you get the Unexpected < token.
In other words, don't nest <script> tags. Removing the outermost Tag should fix the error.
Rails will not let me run JS code, I have these errors
1)
2)
whenever you add JS code, the errors appear.
Some idea why this happening?
Just because you're getting error highlights in your IDE, doesn't necessarily mean your code is wrong. Try running your server, navigate to your site from your browser, and check the developer console. Do you still see javascript errors?
This warning (it is not an error) is being displayed because your IDE thinks that the variable $ is not defined in your code. However, it is not able to find out that $ is a global variable defined in the jQuery library, imported a few lines before.
The IDE is just saying that the presence of that variable is not guaranteed unless you properly import the needed libraries to make it exist (jQuery in this case). Your code should work properly. In order to identify errors in your javascript code, I would recommend you to use the built in console in the web browser.
I get the following error in Firebug for my JavaScript application:
SyntaxError: missing ; before statement when adding new script
The error relates to Google Analytics, but I only get the error when I add another script using RegisterStartupScript. I've had same error point to the script below whilst testing too, so I think the Google thing is a red herring.
Here is the script that gets rendered:
<script src="https://www.thedomain.com/pixel/confirmationjs?pthru=1055|1|pixeltest|27902471&dlp=1.20">
</script>
How do I solve this problem in ASP.NET with RegisterStartupScript?
When getting your technical info of a salesman, never accept what he says to be the complete story or the whole truth!
Turns out that the pixel image I was testing against was single use only, so it worked first time and gave an error on subsequent calls.
I got a javascript error "Uncaught SyntaxError: Unexpected token ILLEGAL" in chrome's debugger while loading a page. we're using a customised version of dojo 1.4.x
n.text = code;
I noticed that the variable "code" had a huge amount of application code. Somewhere inside, it appears is the javascript syntax error. Since the code is huge, I don't know where exactly the problem is coming up. How do I go about narrowing down where the the problem is ?
Use the debugger to get the value of the code variable, and copy it to the clipboard.
Paste it into a blank HTML document, or an empty JSFiddle, and run it with the console visible. That will show you where the syntax error is.
(Even if there are missing dependencies etc., a syntax error ought to show up.)
Page here
Seems like chrome is the only browser having problems with this bit of javascript. I have found that if I remove the '//' from the CDATA tags chrome will give me a line number for the error - line 48. I dont even know where start with this bug unfortunately. The code works as expected but it just takes a bit longer to load/parse with chrome.
I have tried to use script as an external file (float.js) but the error is the same. In production the code will need to be included in the html body though. Any suggestions?
Edit: It was an extension causing this error, is there any way to code against this?
it was the 'Smooth Gestures' extension. removing fixed