7 Replies Last post: May 23, 2013 3:36 AM by Moloth McDowel  
Sandro Ducceschi Newbie 4 posts since
Mar 21, 2013
Currently Being Moderated

Mar 21, 2013 8:22 PM

Please provide: "Live Edit - Javascript" Example

Hi everyone,

 

i'm currently evaluating WebStorm/PHPStorm and am very satisfied so far with all the features.

 

One thing that i would like to get working but don't seem to be able to is Live Editing for Javascript

files.

 

As a test, i created a small HTML File containing nothing much but some DIV with text. A CSS

File that is generated via a watcher from a LESS file.

 

And i reference a javascript file via a common SCRIPT tag.

 

Now here is my issue, for the life of me i can't seem to get live editing of that javascript to work.

 

I've read somewhere that JS files are being hot swapped and they should be "event driven" or cyclic

to make sure that live editing works with them.

 

Can anyone provide me with an example what that exactly means ?

 

This pretty much is the only thing preventing me currently from going all out and purchasing PHPStorm.

Kirill Safonov Apprentice 584 posts since
Jul 9, 2009
Currently Being Moderated
Mar 21, 2013 8:44 PM in response to: Sandro Ducceschi
Re: Please provide: "Live Edit - Javascript" Example

Hi!

 

> I've read somewhere that JS files are being hot swapped and they should be "event driven" or cyclic

> to make sure that live editing works with them.

 

JavaScript live edit replaces your JS code in browser with new one when you change it. But if the code has already been executed (e.g. on page load), it will not be executed again. Opposite, if your function is triggered by timer or e.g. as part of click handler, on the next invocation (e.g. click) you'll have new code running.

 

My colleague will get back to you to help you troubleshoort why it is not working. Meanwhile you could try the very simple example of a webpage with one button that alerts() on click, and try to change the message text via live edit...

 

Kirill

Vladimir Krivosheev Novice 211 posts since
Mar 3, 2007
Currently Being Moderated
Apr 3, 2013 6:45 PM in response to: Sandro Ducceschi
Re: Please provide: "Live Edit - Javascript" Example

Just use literal instead of file-level variable ("someText" instead of testString). I don't know why, please watch http://youtrack.jetbrains.com/issue/WEB-7390

Vladimir Krivosheev Novice 211 posts since
Mar 3, 2007
Currently Being Moderated
Apr 4, 2013 12:52 PM in response to: Sandro Ducceschi
Re: Please provide: "Live Edit - Javascript" Example
Moloth McDowel Newbie 7 posts since
May 22, 2013
Currently Being Moderated
May 23, 2013 3:36 AM in response to: Sandro Ducceschi
Re: Please provide: "Live Edit - Javascript" Example

I solved a similar issue by deleting the deployment.

 

File > Settings > Deployment > Hit the Minus and Apply

More Like This

  • Retrieving data ...