javascript

jquery ajax history and bookmarking plugin

There are plugins for handling history and bookmarking like: http://plugins.jquery.com/project/history. Somehow it doesn't look as a complete solution. For example, on one page you might have a filter that consists of several checkboxes, text boxes etc. You would like your page history functionality to update all those controls and to up...

Place javascript files in 12 Hive or in Document Library?

Besides the obvious benefit of placing the custom javascript files (or any other resource files) in a document library, such as: versioning, history, tracking easy to change/edit Is there any other benefits? Performance? Page Load time? Are there any cons? PS. This is not meant as a question on number of files / resources has a ge...

how to get span selected portion using Javascript

Hi guys is there a way to get the highlighted selectionstart and selectedlenght on a span ? Thanks ...

Text blinking jQuery

What is an easy way to make text blinking in jQuery and a way to stop it? Must work for IE, FF and Chrome. Thanks ...

[JavaScript]: How to call the function in this file?

I pasted the code given in this link to a file called md5.js. http://www.webtoolkit.info/javascript-md5.html I am not able to call the function in my below code. Please assist me. function inc(filename) { var body = document.getElementsByTagName('body').item(0); script = document.createElement('script'); script.src = fi...

Transform string into image with JQuery

Another JQuery question for you guys. Say I have a url of an image in my web page surrounded by square brackets. [http://www.example.com/picture.jpg] How could I, with JQuery transform that string like so... [http://www.example.com/picture.jpg] into... <img src="http://www.example.com/picture.jpg" /> ? ...

Insert Javascript in ASP.net

I am using visual basic for coding. In my form I have a delete button for deleting a record. Now I want to show a Confirm msgbox using javascript instead of using visual basic. What is the javascipt code for the msgbox & Where do I insert this code? ...

Is it possible to destroy loaded JavaScript, including function & local variable?

I know. It is possible to dynamically load JavaScript and style sheet file into header of document. In the other hand, it is possible to remove script and style sheet tag from header of document. However, loaded JavaScript is still live in memory. Is it possible to destroy loaded JavaScript from web browser memory? I think. It should be...

Why is there no OFFICIAL JavaScript reference?

I tried to search for a JavaScript reference, but there's none available. The best two suggested sources are MDC and W3Schools. Why? ...

Knowing whether window.close() will show a security warning

In IE7, a child window opened with window.open can close itself using window.close(), but a window opened with <a href=... target=_blank> will show a security warning if the child window tries to close itself. In my application, I don't know how my child window is opened, and I need to know (in the child window javascript code) whether ...

Using javascript substring() to create a read more link

Hi there, I'm developing a Classic ASP page that pulls some content from a database and creates a Read more link after the first 100 characters as follows; <div class="contentdetail"><%=StripHTML(rspropertyresults.Fields.Item("ContentDetails").Value)%></div> <script type="text/javascript"> $(function() { var cutoff = 200; ...

Meaning of forEach(function(tag) in JavaScript

Hello, I came across the following code fragment in a CouchDB book. function(doc) { doc.tags && doc.tags.forEach(function(tag) { emit(tag, 1); }); } Can some one explain how does the function(tag) part works? Thanks and regards, raj ...

Troubleshooting Raphael translation animation

Hi, I'm attempting to use Raphael to make a small game, and just want a bit of advice on some code I'm working on. Here's what I have so far, its just a simple example of moving a circle around the screen: <script type="text/javascript" charset="utf-8"> window.onload = function () { var paper = Raphael(10, 50, 320, 200); var paper ...

Font picker Implementation

Hi, I want to implement a font and color picker in my project. I implemented the color picker, I got it the code, but still I don't get the code to implement the font picker. Does any one know? Thanks in advance. ...

How to aceess span directly using jQuery

Hi All, I want to know how to get access of this [span class="myclass"] in below html structure.. <ul> <li class="first"> <span class="myclass"></span> <div class="xx"> <span></span> ........ </div> <li > <span class="myclass"></span> <div class="xx"> <span></spa...

Use of .apply() with 'new' operator. Is this possible?

In JavaScript, I want to create an object instance (via the new operator), but pass an arbitrary number of arguments to the constructor. Is this possible? What I want to do is something like this (but the code below does not work): function Something(){ // init stuff } function createSomething(){ return new Something.apply(null...

How can I get a file's upload size using simple Javascript?

I have upload file functionality on one of the page. I check for the extension of the file using JavaScript. Now i want to restrict the user from uploading file greater than 1 MB. Is there any way i can check the file upload size using JavaScript. My code currently look like this: <script language="JavaScript"> function validate() { ...

Are there any getter jQuerys CSS translation?

Hi all, jQuery's cross browser support is amazing. However I was wondering whether the following script will work in any browser or not. $("#block1").css('background','blue'); $("#block2").css('backgroundColor', '#0000ff'); $("#block3").css('background-color', 'rgb(0, 0, 255)'); if ( $("#block1").css('background-color') == $("#block2"...

How to get innerhtml value in mozilla

Hi, I have below html code <div id="divTest"> Hello <input type="text" id="txtID" value="" /> <input type="button" onclick="getForm();" value="Click" /> </div> And I have below javascript function to get innerHtml value <script language="javascript" type="text/javascript"> function getForm() { var obj =...

jQuery, Uncaught TypeError

Hi, I have some javascript code on my webpage that is loading some divs onto the page. I also want to add onmouseenter, and onmouseleave event handlers to each div. I am using jquery to add these handlers, but i get the error: "Prpoerty '$' of object [object DOMWindow] is not a function" My code looks like this, it is in a for loop: ...