Is there any way to find out what script applies to certain HTML elements? With inspect element you can see the styles applied to elements and I'd like to check what javascript is applied also.  Example(this is what actually made me ask the question):    When you hover an item, a few things are happening and I'd like to know witch script(there are many scripts included in the html page) is responsible for the effects, and if all the scripts were merged into one .js file, would be nice to know the code responsible for the effect.  There are a lot of scripts and would be nice to know witch does certain things to the html elements.
21250
I have a page where some event listeners are attached to input boxes and select boxes. Is there a way to find out which event listeners are observing a particular DOM node and for what event?  Events are attached using:    Event.observe; DOM's addEventListener; As element attribute element.onclick.
34279
What is the  type of javascript?   More specifically, what is the right thing to put in the "type" attribute of a script tag? application/x-javascript and text/javascript seem to be the main contenders.
9151
How can I check the existence of an element in jQuery?  The current code that I have is this:  if ($(selector).length &gt; 0) {     // Do something }   Is there a more elegant way to approach this? Perhaps a plugin or a function?
19563
Can I use JavaScript to check (irrespective of scrollbars) if an HTML element has overflowed its content? For example, a long div with small, fixed size, the overflow property set to visible, and no scrollbars on the element.
24574
I would like to know when I should include external scripts or write them inline with the html code, in terms of performance and ease of maintenance.  What is the general practice for this?  Real-world-scenario - I have several html pages that need client-side form validation. For this I use a jQuery plugin that I include on all these pages. But the question is, do I:   write the bits of code that configure this script inline? include all bits in one file that's share among all these html pages? include each bit in a separate external file, one for each html page?   Thanks.
42087
Writing a python script and it needs to find out what language a block of code is written in. I could easily write this myself, but I'd like to know if a solution already exists.  Pygments is insufficient and unreliable.
21162
I am trying to style all the HTML elements by making a custom style sheet. Till now, i have succeeded in making only the radio-buttons and check-boxes.  is the link for the demo. I wanted to know what are the formal guidelines for UI designing while styling these controls so that they appear more clickable. And what more could be done to make the example more pleasant looking.
122496
Is there a way to find JavaScript variable on the page (get it as an object) by its name? Variable name is available as a string constant.
38027
I need a way to determine the type of an HTML element in JavaScript. It has the ID, but the element itself could be a &lt;div&gt;, a &lt;form&gt; field, a &lt;fieldset&gt;, etc. How can I achieve this?
59896
Lets say I have a web app which has a page that may contain 4 script blocks - the script I write may be found in one of those blocks, but I do not know which one, that is handled by the controller.   I bind some onclick events to a button, but I find that they sometimes execute in an order I did not expect.   Is there a way to ensure order, or how have you handled this problem in the past?
16771
I want to make a JavaScript application that's not open source, and thus I wish to learn how to can obfuscate my JS code? Is this possible?
966
For testing the visual appearance of a website the use of tools like selenium (functional surface test) is not sufficient because it doesn´t check the visual appearance and/or the CSS-Code directly. Different approaches are possible   Defining style guides Syntax checking of CSS and HTML DOM comparison Screenshot comparison   How do you check the visual appearance of websites from a web-application?   I implemented a screenshot comparison tool in Java. Screenshots are generated by a framework based on selenium. I started with pixel by pixel comparison. Actually I split the screenshot into different parts (maybe 10x10 rectangles) and compare the histograms of corresponding parts. For the future I want to determine relevant parts (regions of interest) automatically. Maybe someone has ideas how to do that.
123687
Say I have a fairly hefty JavaScript file, packed down to roughly 100kb or so. By file I mean it’s an external file that would be linked in via &lt;script src="..."&gt;, not pasted into the HTML itself.  Where’s the best place to put this in the HTML?  &lt;html&gt; &lt;head&gt;     &lt;!-- here? --&gt;     &lt;link rel="stylesheet" href="stylez.css" type="text/css" /&gt;     &lt;!-- here? --&gt; &lt;/head&gt; &lt;body&gt;     &lt;!-- here? --&gt;     &lt;p&gt;All the page content ...&lt;/p&gt;     &lt;!-- or here? --&gt; &lt;/body&gt; &lt;/html&gt;   Will there be any functional difference between each of the options?
93179
Quite often I come across a nice looking or functional website, and wonder what technology was used to create it. What techniques are available to figure out what a particular website was built with?  Few frameworks seem to include any kind of generator meta tag like web editors do. Are there any tell-tale signs of particular languages and/or frameworks?    Summary of answers  Site URLs may betray the framework and/or programming language but cannot be relied upon (e.g. file extensions such as .asp). HTTP response headers, cookies, stylesheets and source comments may also give clues.  Some nice tools for querying site details (no doubt there are many more):          Firefox addons:    - CMS, frameworks/libraries, e-commerce, message boards etc.  - IP, country and webserver details  - Javascript libraries in use   Chrome Extensions:        Bookmarklets:    - shows Javascript framework in use
85910
Using jQuery, how would you find elements which have a particular style (eg: float: left), regardless of whether it's an inline style or one defined in a CSS file?
104708
I'm working on a web page where I'm making an AJAX call that returns a chunk of HTML like:   &lt;div&gt;   &lt;!-- some html --&gt;   &lt;script type="text/javascript"&gt;     /** some javascript */   &lt;/script&gt; &lt;/div&gt;   I'm inserting the whole thing into the DOM, but the JavaScript isn't being run.  Is there a way to run it?    Some details: I can't control what's in the script block (so I can't change it to a function that could be called), I just need the whole block to be executed.  I can't call eval on the response because the JavaScript is within a larger block of HTML.  I could do some kind of regex to separate out the JavaScript and then call eval on it, but that's pretty yucky.  Anyone know a better way?
75718
I'm dynamically adding &lt;script&gt; tags to a page's &lt;head&gt;, and I'd like to be able to tell whether the loading failed in some way -- a 404, a script error in the loaded script, whatever.  In Firefox, this works:  var script_tag = document.createElement('script'); script_tag.setAttribute('type', 'text/javascript'); script_tag.setAttribute('src', 'http://fail.org/nonexistant.js'); script_tag.onerror = function() { alert("Loading failed!"); } document.getElementsByTagName('head')[0].appendChild(script_tag);   However, this doesn't work in IE or Safari.  Does anyone know of a way to make this work in browsers other than Firefox?  (I don't think a solution that requires placing special code within the .js files is a good one. It's inelegant and inflexible.)