I am trying to use the following link to trigger event tracking in GA
<a href="/wp-content/uploads/2017/07/2017-brochure-web.pdf" target="0" onClick=”ga(‘send’,‘event’,‘Online Brochure’,‘Download’,‘Product Brochure’,10);”>DOWNLOAD BROCHURE</a>
Console is giving me this error:
Uncaught SyntaxError: Invalid or unexpected token
any ideas what is causing that error?
This error is occurring because starting at onClick there are left and right single/double (‘ ’ ”) quotation characters rather than neutral quotation marks (") and apostrophes ('). This can happen when copying and pasting from various sources.
Your code will work if you replace the left/right single/double quotation with neutral versions.
Hopefully that helps!
Related
Expression Activity type 'VisualBasicValue`1' requires compilation in order to run. Please ensure that the workflow has been compiled.
how to solve this error
This can happen when a string with quotes is copied from a RTF formatted app, such as Microsoft Word. The " quotation character is not the code version. Try deleting the current assignment in the write cell activity and type manually so that the quotes (") are of the right type. Notice the slanted quotes vs. the straight quotes in the two examples below:
“This is a quote from an RTF app”
"This is a quote from a code editor"
I was working with xliff file without any issues translating one of my apps to spanish. Now all of sudden Xcode's "Export for Localization" feature has stopped working. If I go to Editor->Export for Localization nothing happens, I am asked where I want to save the xliff file but when I select a location nothing happens. If I try to do the export again I get an error message saying: "There is a localization operation in progress".
I've tried restarting Xcode and my computer to no avail. Has anybody else encountered this issue?
I just ran into the same problem! In my case, it was because the file Localizable.strings contained strings with quotes in them.
E.g. your file may contain something like this line:
"This is a “test”." = "Das ist ein "Test".";
Xcode's code highlighting will show that something is wrong:
The original English sentence works because the quotes in the string are smart quotes, but the quotes in the German translation interrupt the string and make it invalid.
This problem could be in any of your strings files, like Localizable.strings, InfoPlist.strings etc. To find lines like this in a large strings file, you can search by Regular Expression with this expression:
(".*){5}
This will find all lines that have more than 4 quotation marks. As I mentioned, smart (curly) quotes are accepted. You can use normal quotes by escaping them - so this would also be acceptable:
"This is a “test”." = "Das ist ein \"Test\".";
Given:
echo '"Number' > temp.sh
./temp.sh
With this script, Bash prints this error message:
./temp.sh: line 1: unexpected EOF while looking for matching `"'
Why does it print out `"' versus something like '"'?
PS: I tried searching for a answer but only got answers to questions asking for help debugging this error. Instead I want to know why the error message prints outs a starting backtick versus a single quote.
Using separate open and close quotes is historically considered good form in English, and an essential part of proper typography. This fell partially out of style due to cost-saving measures (and attempts to conserve the limited 7-bit ASCII character space), but has never completely disappeared.
From Practical Typography:
Curly quotes are the quotation marks used in good typography.
From Wikipedia:
"Ambidextrous" quotation marks were introduced on typewriters to reduce the number of keys on the keyboard, and were inherited by computer keyboards and character sets. Some computer systems designed in the past had character sets with proper opening and closing quotes. However, the ASCII character set, which has been used on a wide variety of computers since the 1960s, only contains a straight single quote (U+0027 ' apostrophe) and double quote (U+0022 " quotation mark).
...and, a few paragraphs below, referring specifically to the (mis)use of the backtick as an open quote:
These same systems often drew the grave accent (`, U+0060) as an open quote glyph (actually a high-reversed-9 glyph, to preserve some usability as a grave). This gives a proper appearance at the cost of semantic correctness. Nothing similar was available for the double quote, so many people resorted to using two single quotes for double quotes, which would look like the following: [...]
I have this part of script in my website:
this.isAuto=!1!==this.o.auto&null!==this.o.autoMode.match(/^loop|bounce$j/); w3 validation
I am getting validation error at auto&null, n is red
here is the message:
Warning Line 205, Column 409: cannot generate system identifier for
general entity "null"
…h,b||{});this.isAuto=!1!==this.o.auto&null!==this.o.autoMode.match(/^loop|boun…
✉
An entity reference was found in the document, but there is no
reference by that name defined. Often this is caused by misspelling
the reference name, unencoded ampersands, or by leaving off the
trailing semicolon (;). The most common cause of this error is
unencoded ampersands in URLs as described by the WDG in "Ampersands in
URLs".
Entity references start with an ampersand (&) and end with a semicolon
(;). If you want to use a literal ampersand in your document you must
encode it as "&" (even inside URLs!). Be careful to end entity
references with a semicolon or your entity reference may get
interpreted in connection with the following text. Also keep in mind
that named entity references are case-sensitive; &Aelig; and æ
are different characters.
If this error appears in some markup generated by PHP's session
handling code, this article has explanations and solutions to your
problem.
Note that in most documents, errors related to entity references will
trigger up to 5 separate messages from the Validator. Usually these
will all disappear when the original problem is fixed.
I hope some one can help with that
Thanks
i am learning xpath, and i am trying to get some data from html usint xpath
i found that google chrome has a option to "copy xpath" and it works nice
but doesnt work to this exemple
<div id="site-main">
<header class="main" role="banner">some divs </header>
</div>
i use this on google chrome console
$x("//*[#id="site-main"]/header")
and return "SyntaxError: Unexpected identifier"
i dont see anythin wrong...do you?
$x("//*[#id="site-main"]/header")
^ ^
The marked quotes cause the error — in fact, the string is terminated right after =.
You have to escape the quotes inside the XPath expression. The way of escaping depends on the language you are using. If it's Javascript, then it would be with \:
$x("//*[#id=\"site-main\"]/header")
Also have a look on this question: Escape quotes in JavaScript
You can use single quotes in the xpath query:
$x("//*[#id='site-main']/header")