Why does JavaScript break after decompressing? [closed] - javascript

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.
Closed 9 years ago.
Improve this question
I am trying to evaluate a very large JavaScript code. The file has been compressed with JavaScript Compressor and it was hard to understand the code. So I decompressed it using the JSFormat Package of Sublime Text editor. The code is now good to read however, when I run it in browser the code breaks. Why does this happen and what can I do to prevent it?

If the JavaScript in question runs in a web browser and works in Chrome, consider decompressing it using Chrome's built in JavaScript beautifying function, "Pretty print".
You can access the pretty printing feature by navigating to the developer console's script tab and clicking the {} curly brackets in the bottom left corner of the screen—if they're blue, the feature is on. Chrome's routines are probably more robust than the Sublime Text module's, so you might stand a better chance of getting working code out of it.
If by following the steps above you actually do manage to get working, cleanly formatted code, you can satisfy your curiosity by running the output of both code formatting engines through a diff program.

Related

How can I edit javascript in a browser [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 2 years ago.
Improve this question
I'm trying to modify a webpage I access that has a table with a bunch of rows. I'd like to loop through and compare a name in that row with a name on another list I have, if it's there make that name in the table red. I don't have any code yet, but I'm lost when it comes to figuring out how to run this code when I run the webpage in my chrome browser. Does anyone have an example or tutorial about how to do this? Most posts on this topic are many years old and it's been hard to find this info. I appreciate your help!
It sounds like what you're trying to do is modify the structure of a webpage you don't own the code to. While you can use the developer tools to run arbitrary JS, that becomes tedious to do every single time.
I think what you want is a browser plugin. Check out the resources below:
Chrome: https://developer.chrome.com/extensions/getstarted
Firefox: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Your_first_WebExtension
There may also be specific browser plugins already that let you run arbitrary JS code on certain pages, but I am not aware of any myself.

not able to run modified js code in chrome dev tool [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 4 years ago.
Improve this question
I am not able to run the modified code, after modification still chrome is debugging older code. I can see the green color on the web page which denotes that its pointing to the local file saved in my system. But still not able to run the modified code. I am able to do so by using console to modify the js files.
I am really stuck for 3 days and now i am pretty confused whats going on. I searched on google but it seems not working.
Try the below steps-
• Clear the browser cache.
• In case you are using Visual Studio, clean and the rebuild the solution. Or do the equivalent if you are using any other IDE.

Having issue in JavaScript and PHP Code [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
I have a issue in my website (http://www.unlockgsmcodes.com/unlock-samsung/). My website was working fine few days ago then suddenly javascript is not working on my website. And php code is displayed in textboxes.
I developed my website in wordpress.
For php code i am using plugin "Allow PHP in Posts and Pages"
I am giving you couple of suggestions, have a look into them-
If any page template, then check the PHP code. Mainly, start and end.
If your page in page (dashboard>pages). I mean value printed using
any plugin, then you deleted that plugin which was printing the value
in your input field.
If your page created using any form plugin. Then check the form plugin. Is it deactivated or not?
Open console in Chrome and you will see: Uncaught TypeError:
jQuery(...).on is not a function - is the reason, why javascript is
not working (I am adding #deniskoronets comment here)
Also use $.noConflict() or jQuery.noConflict() in your scripts
BTW, If you want best answer then you need to post more clue/information.
Thanks

Is there a IDE that will debug HTML, JavaScript and PHP as one page? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
Is there a IDE that will debug HTML/PHP/Javascript on one page, there must be a more efficient way of error finding. Currently I'm using Dreamweaver and if I have a error in my JavaScript or PHP I'm forced to either copy and paste into another environment or read error messages on my testing server.
I've tried Microsoft Visual Studio and it seem like the learning curve is a little steep?! Is Netbeans advisable?
Ideally I would like to carry on using Dreamweaver then if need be just open the page in another IDE, debug, save and reopen in Dreamweaver.
I'm using Netbeans, which can use breakpoints in PHP using X-Debug. It was must-have for me, but now i hardly use the feature since i found the combination of php_error.log + custom log/error outputting easier.
For HTML and Javascript debuggin i simply use Chrome Developer Tools (Rightclick > Inspect, or keyboard shortcut CTRL+SHIFT+i). The Elements and Console tabs should help you out.
I see no reason to have PHP and JS debug output intertwined, as they never are. There is a linear path here: PHP builds HTML+JS, JS affects HTML, browser renders HTML.
There is also Embarcadero HTML5 Builder that is said to be highly integrated, i never used it though.
Not sure but WebStorm is pretty nice to debug Js. It also help for php and html.

javascript - information required [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I am presently studying javascript coding practice on CodeAcademy. When testing code in Codeacademy I use console.log to output strings to the built in browser within Codeacademy. The code works fine. The first issue is this: When I test the same piece of code within Dreamweaver text editor and output it to the browser it prints nothing, I have to change it to document.write for it to work.
Next Part
I then read somewhere that using document.write in production code is not recommended! Can somebody explain this.
Next Part
I was at a brief introduction to JS free meeting a few days ago. At this meeting it was suggested that using something like prompt("La di da"); is not recommended in production work.
If anybody has the time and energy to explain why these things are built into JS but no recommended to be used or why they do not work when used, I would be very grateful.
Code Academy will be emulating a console in their web application. Press "F12" in most browsers, and you'll get "Developer Tools" opening up; which will have a console built in, which is where console.* (including console.log()) calls get output to.
Like I said, Code Academy will have some of their own JavaScript, which will be catching these calls, and to make their tutorials easier to use, outputting it to a place which is easier for you to see.
Dreamweaver however, won't be doing this, which is why you're not seeing it.
There is nothing inherantly wrong with using document.write. However it behaves differently depending on whether the page has loaded or not, and there are generally friendlier and more useful alternatives such as document.getElementById() for targeting where to direct output.
For more info, see Why is document.write considered a "bad practice"?
As with document.write, there is nothing wrong with prompt(), confirm() etc; Stack Overflow themselves use confirm() on their websites. The downside is that they cannot be styled, and prompt() for example, is restricted to asking for one thing at a time.
Model windows however (such as jQuery UI dialog, Bootstraps "Model" or various lightbox plugins, can be.

Categories

Resources