javascript

Know the length of an input in Javascript

Hello, how to know the length of an input in Javascript alert("Size: "+document.getElementById('champ').length) not work undefined ...

how to create watermark effect using jquery in asp.net

I got this article for doing this but i found that this is not working as i have given multiple classes in same textbox. How to convert this to work with multiple classes. I dont know how to use selectors to work with. I am using it like this <div class="inbox3full"> <div class="threeinbg"><asp:TextBox ID="txtSortOrder" CssClass="t...

Javascript jQuery only shows Image element once in IE. FF works

I want to show a big Image when I press the small thumbnail. A simple Lightbox style script. When I press the grey transparent overlay area around the image, the CSS and image is removed from view. This code is stripped down. Maybe missed something needed... $(document).ready(function() { $(".lightBobo").click(function(e) { ...

HTML/CSS - create alpha mask over image

Hi, I'd like to create an effect in a site I’m building where an image is masked by an overlay. The overlay should create a “fade out” effect — I don’t actually want anything animated, but the overlay should make the image look as if it’s fading to the background colour at the edges. Something like this: http://imgur.com/fqtc9.png I p...

removing double URL ?

at the end u will see double URL coming at the bottom .How we can remove that. ...

Intellij IDEA javascript deprecations

While writing javascript code IDEA adds deprecation warnings for some methods (It strikes it out). Is it some hot-key or menu item that will show where exactly this method was marked as deprecated. ...

formatting code snippets on a web page

How do I add code snippets to a web page? I've built a jquery plugin for my front-end team and I want to build a quick page illustrating its use. I want to include some code and i've seen a few sites using stylized code snippets (colour coding, indentation etc). How is this achieved? ...

How can I access the data from javascript by Qt?

I used webview to show the webpage, view->setUrl(QUrl("C:\\Qt\\2010.07\\qt\\serbest\\googleSearch.htm")); in the HTML code I put some ajax code googleSearch. After I execute the program, the webview runs and there are results (pages links). When I clicked any of the links they do not open. So what do I do to open the links I clicked...

Dynamically naming and implementing the body of a javascript function

For simplicity's sake, I've included a script that dynamically calls a function by its name: var foo = "hello"; var bar = "world"; var function_name = "say_" + foo + bar; // Since its name is being dynamically generated, always ensure your function actually exists if (typeof(window[function_name]) === "function") { window[function_...

WebSocket closes on send

So I saw this great blog post, Experimenting with Node.js. I decided to try and set it up on my own using the author's gist. It didn't work. Further debugging shows me that the the websocket is connecting fine, but is closing as soon as 'send' is invoked. Here is the wireshark trace(forgive the weird spacing): GET /test HTTP/1.1 Host:...

One DIV, multiple UI's, AJAX, and PHP

Hello I'd like to use a single DIV section, have the remote PHP script send a different UI depending on how it was called, and then have AJAX (jQuery) update the DIV accordingly. As a newbie, in the JavaScript/AJAX part, I don't really know how to check which UI the user is currently working with, which I need to know to be able to cal...

rounded corners IE and background images...

hi all I have an item in my page thus: <div class="rounded"> <h2>Heading Text</h2> <ul> <li><a href="/default.aspx">Summary link</a></li> <li><a href="/default.aspx">Summary link</a></li> <li><a href="/default.aspx">Summary link</a></li> </ul> <p>or... some text or whatever</p> </div> the styles associated with this block...

Cloning in-memory image in JavaScript /jQuery

This is probably a really simple one but I couldn't find the answer. I have the following JavaScript/jQuery code where I am trying to create loading messages: // preload an image to use for dynamic loading icon whenever requested $(document).ready(function() { var loadingIcon = document.createElement('img'); loadingIcon.src = '...

how can I play a sound clip on page load?

how can I play a sound clip on page load?Is there any javascript or jquery to do that?I am creating my page in php. ...

xmlhttprequest POST method in rails

In the web, I'm building local file drag and drop upload to the server with the ruby on rails, dragging and drop a file working fine, but how to get the dragged file content in the controller with the drop event? I'm getting the file with event.datatransfer, send file through Javascript with XMLHttpRequest. function handleDrop(event)...

IE 6 javascript object type 'control'?

I have a custom image selector for FCKeditor 2.6.5. Everything works fine on Firefox, Chrome and Safari. But in the IE6 I get a strange type for the selection. The code for this is: alert(editorInstance.Selection.GetType()); And it returns 'Control'. What is this type and how could I access the HTML of the selection instead? ...

Two domains, one site, one SSL checkout. How to get cookies?

Hi, There is a multilingual web shop, visitors can access from two domains, with different language: hxxp://x.com - English hxxp://x.ru - Russian, which is an add-on domain to x.com. The authentication and cart pages are here, through SSL: https://x.com/index.php?mode=login How can I use the cookie informations of x.ru on hxxps://x.co...

How can I call a javascript constructor using call or apply?

Hi, how could I generalise the function below to take N arguments? (Using call or apply?) Is there a programmatic way to apply arguments to 'new'? I don't want the constructor to be treated like a plain function. All the best, Chris. /** * This higher level function takes a constructor and arguments * and returns a function, whic...

why isn't swfobject loading the flash div?

Hi all, i'v edited this page over ftp from a normal pc (without developer tools), wich i can't install here. Can anybody see me why the swfobject isn't loading? thanks in advance ...

Javascript function that returns a DOM when input is html content

Hello, I want a Javascript function that returns a correct DOM when input is HTML content. I have used the follwing function for the same. Here input is HTML content and output is DOM. function htmltoelement(elementHTML) { var temDiv = document.createElement('div'); temDiv.innerHTML = elementHTML; return temDiv;...