Download a file by jQuery.Ajax

2019 modern browsers update This is the approach I’d now recommend with a few caveats: A relatively modern browser is required If the file is expected to be very large you should likely do something similar to the original approach (iframe and cookie) because some of the below operations could likely consume system memory at least as … Read more

How should I initialize jQuery?

The first example runs the function when the DOM tree is built. The second example runs the function right away. If you look closely, in the second example, there are two parentheses after the function declaration ( in this particular case, you pass in the global jQuery object as an argument to avoid conflict ), thereby immediately … Read more

Regular expression to validate US phone numbers?

The easiest way to match both and is to use alternation ((…|…)): specify them as two mostly-separate options: By the way, when Americans put the area code in parentheses, we actually put a space after that; for example, I’d write (123) 123-1234, not (123)123-1234. So you might want to write: (Though it’s probably best to explicitly demonstrate the format … Read more

How to disable auto-start of “Node.js: Server-side JavaScript” when using Adobe Dreamweaver?

Solution: One suggestion in Adobe Forums was to log out of CC. Instead, I disabled all the CC auto-updating services that run when my PC starts up. Here are directions on how to disable startup programs in Windows. Hypothesis: I couldn’t find any documentation specifically about Adobe CC and node.js, but I believe its being used as part … Read more

“Cross origin requests are only supported for HTTP.” error when loading a local file

My crystal ball says that you are loading the model using either file:// or C:/, which stays true to the error message as they are not http:// So you can either install a webserver in your local PC or upload the model somewhere else and use jsonp and change the url to http://example.com/path/to/model Origin is defined in RFC-6454 as So even though your file … Read more

How to disable auto-start of “Node.js: Server-side JavaScript” when using Adobe Dreamweaver?

Solution: One suggestion in Adobe Forums was to log out of CC. Instead, I disabled all the CC auto-updating services that run when my PC starts up. Here are directions on how to disable startup programs in Windows. Hypothesis: I couldn’t find any documentation specifically about Adobe CC and node.js, but I believe its being used as part … Read more

“Cross origin requests are only supported for HTTP.” error when loading a local file

My crystal ball says that you are loading the model using either file:// or C:/, which stays true to the error message as they are not http:// So you can either install a webserver in your local PC or upload the model somewhere else and use jsonp and change the url to http://example.com/path/to/model Origin is defined in RFC-6454 as So even though your file … Read more