简体   繁体   中英

Storing SVG paths as javascript variables

I seem to be having a bit of an issue storing an SVG path string in a simple javascript variable. This is a bit mystifying to me and I haven't been able to find anything that points to why this might be happening.

The path is stored in a single-line string, with double quotes on each end. That's the only thing in this file, yet when I try to utilize the string with Raphael.js I'm getting that exception error. Thoughts? Any help greatly appreciated.

http://www.screencast.com/t/BR1DHuH2bNm

It is not legal in JavaScript to spread a string across multiple lines like it appears to be in your screenshot. You might edit your code so that the string being assigned to greenland is all on one line or put a backslash to escape the newline character at the end of each line in the string.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM