javascript

How do we prevent default actions in JavaScript?

What is the cross-browser method? I need to prevent any default action on an image, so that neither dragging nor anything else will fire on a default bases. ...

Javascript Tablemodel Widget

I am looking for a JavaScript MVC table widget similar to Java Swing TableModel I would also like to have two models, one totally local and one remote (XMLHttpRequest) I would also like the view to accept text columns (and maybe HTML columns) and have these text columns HTML or CSS formated depending the cell contents (just like you wo...

want to read number of words and charecter using javascript

consider, in my javascript i am getting : function callBack_Show(result) { //where result is in jsonp format var artical= result.Artical; now artical contains some text, i want to read number of words and characters in it and display them the words can be separated by: blank space, fullstop,comma etc and i want to do it in same java...

How do I disable the image toolbar for images in IE?

When hovering the mouse over images IE pops up a little toolbar that suggests saving, printing and so on. Here's a pic of this: I need to accomplish this with JavaScript. ...

"Access is denied" JavaScript error when trying to access the document object of a programmatically-created <iframe> (IE-only)

I have project in which I need to create an <iframe> element using JavaScript and append it to the DOM. After that, I need to insert some content into the <iframe>. It's a widget that will be embedded in third-party websites. I don't set the "src" attribute of the <iframe> since I don't want to load a page; rather, it is used to isolate...

How to make CKEditor render text with a CSS ?

I have a CKEditor used to edit a text in a web-page. In the web-page, the text renders in its context and therefore follows the page CSS formatting. My question is how to tell CKEditor to apply a CSS style-sheet to the editor rendering ? Without of course changing the generated source ? My code : <textarea class="ActuContent" name...

get element via coordinates?

High all, I was wondering if it was possible to select an on page element via its coordinates? reason being i'm trying to make an editable page where you can right click on highlighted elements, menu appears and then select from the options give. using the only method i could find that worked to select the element via hover it uses (eve...

query list of dijit checkboxes inside a DIV

I need to find all dijit.form.CheckBox widgets inside a DIV and enable/disable them all. I am not able to form appropriate query for it. I tried dojo.query("[dojoType~=dijit.form.CheckBox]") but it gives me an empty list. What is the appropriate query for it? Can DOJO query return a WidgetSet or does it always returns DOM ids? Is ther...

how to disable the image toolbar

Hello! How can I disable the image toolbar that popups whenever mouse pointer is over an image. I need to do this within javascript only. ...

PHP Remove JavaScript

hey guys i am trying to remove javascript from the html but i am not getting the regex to work with php its giving me an null array here is my code <?php $var = ' <script type="text/javascript"> function selectCode(a) { var e = a.parentNode.parentNode.getElementsByTagName(PRE)[0]; if (window.getSelection) { var s = ...

Javascript syntax error... How can I find out more information?

Apologies if this is a stupid question as Im completly new to JAvascript and web programming! I'm currently using Dreamweaver to do some test scripts and the internal JS editor is highlighting a syntax error with my script. The only problem is that there is no indication as to what the error is or what I might need to do to fix it! Whe...

Array under another array in javascript.

This is probably a fairly simple way to do it, but I ask since I did not find it on google. What I want is to add an array under another. var array = []; array[0]["username"] = "Eric"; array[0]["album"] = "1"; Something like this, I get no errors in Firebug, it does not work. So my question is, how does one do this in javascript? ...

How to get the background color of an element using javascript?

How can i get the background color of any element, say Div, using javascript. I tried:- <html> <body> <div id="myDivID" style="background-color: red">shit happens</div> <input type="button" value="click me" onclick="getColor();"> </body> <script type="text/javascript"> function getColor(){ myDivObj = ...

How to do this in jQuery?

I have to attach the method copyToLeft on onClick event of all images which are inside the TD. TD is inside the table named mismatchList, so that the structure becomes like this mismatchList > tbody > tr > td > img Although i have already done this, but that is using plain javascript. What i did was, i manually added copyToLeft(this)...

Javascript extend objects in variable

I have a function that contains messages for form field validation. However I would like to have default messages but also have the possibility to add custom messages later on from a different function (on the fly). I have tried something using php and extending a class and adding more messages and than building the javascript but I'm n...

Which tools do you use to debug HTML/JS in your browser?

I'd like to collect the best debugging aids for all browsers out there. So that would probably be Firebug for Firefox but what do you use for IE? Safari? Opera? Opera Mini? What else is out there? Are there tools that work well for IE 6? IE 5? ...

Javascript date field utility

I need to do date validation for international date formats. The utility should pass following date formats 12 November 2009 12-november-2009 12-nov-2009 12-novembber-2009 Note that the last one has spelling error. However one needs to look at only three letters 'nov' to identify that it is November. I was wondering it there is a Java...

javascript image rollover

Hi I have a question about image rollover but it's not how you'd think. I've seen an example http://www.asos.com/ and click the home button(top nav far left) You can see that when you rollover an image that image stays highlighted and the others darken. I know this has been done with jquery but the code is very messy. Has anyone seen...

Is there any other tool better than Firebug on any other browsers?

Is there any other tool better than Firebug on any other browsers? free or commercial? or any other similar tool which has any single or multiple function which can be useful along with firebug ...

javascript or css trick to group spans without separating them when one reaches the edge of browser

so we have three spans and a parent span <span id="parent"><span1></span><span2></span><span3></span></span> when one of the spans reach the right end of the browser, it moves down, leaving its siblings behind. Are there any tricks here on how to keep these spans together that if one moves down, the others will follow? Thanks. ...