javascript

Simple Ticker (jQuery)

<ul> <li><a href="#">one</a></li> <li><a href="#">two</a></li> <li><a href="#">three</a></li> </ul> I'd like to show only one li at a time using slide effect, thats it. I'd like to avoid using plugins for something as simple as this. Thanks in advance for your help. ...

AddThis share button wont work in DotNetNuke

For some reason when I add a HTML module (well the default module added to DNN 5.4) and then add the "AddThis" javascript. While the button shows up clicking on it opens up a new page rather than showing an iframe modal message or on hover a list of popular social media networks to share the page with. Wonder what would be the easiest wa...

Event Triggering in asp.net using javascript

i have created two buttons using html. yes and No. i need the get the event triggered when the button is clicked i.e... onclick=getvalue(). public void SetYesButton(string msg_button_class) { this.msgbox_Yes_button = "<input type=\"button\" value=\"Yes\" class=\"" + msg_button_class + "\" onClick=\"getvalue()\";>"; } public...

Using jQuery to store basic text string in mySQL base?

Could someone point me in the right direction here? Basically, I've got this jQuery code snippet: $('.bggallery_images').click(function () { var newBG = "url('" + $(this).attr('src'); var fullpath = $(this).attr('src'); var filename = fullpath.replace('img/Bakgrunner/', ''); $('#wrapper').css('background-image', newBG);...

jQuery and ASP.NET drop down problem

I have a drop down in an ASP.NET page. Whenever the value of the drop down changes an ASP.NET AJAX request is made to the server. I also attached a jQuery "change" event handler to that list to execute some code when the value is changed. So, probably two different event handlers are being attached to the same drop down, and it's causing...

How to add an element to 'body' using Prototype?

I have created an element like this: var myDiv = new Element('div'); myDiv.update('Hello!'); I want to add myDiv to body. I tried $('body').insert(myDiv); But it is not working. I also tried $('body')[0].insert(myDiv); thinking that $('body') was returning an array. Even that didn't work. How can I add myDiv to body? Thanks. ...

HTML5 Canvas + select / drag-and-drop features in a JS lib?

Hi, I'd like to use HTML5 Canvas, but I'd like to use it in terms of shapes, texts and curves, able to attach traditional DOM events like onClick or drag-and-drop functions. Is there any Javascript library that is able to do that for me? I've seen that gwt-canvas is close to this approach, but haven't looked it in details. Thanks, I...

how to compress more jquery file?

is there any way to compress more jquery base file? what i have is about 56K and i need a more light file because of dial-up speed(56k). ...

tree element in firefox sidebar with dynamic elements and click functionality

I have created an extension to show a sidebar in firefox. Now i need to display a tree like structure where the third level will be dynamic and loads a particular link on clicking. I know how to create the three level hierarchy but with static data.. heres the code <treechildren> <treeitem container="true" o...

Needed list of special characters classification with respective characters

I am working on one web application , It's related to machine translation support i.e. which takes source text for translation and translated in to user specified language Currently it's in unit testing phase. Here, i want to check that, whether my machine translation feature is fully working for all the special characters. Because of ...

Adding delay to mouse out function.

I have one drop down menu, <ul> <li><a>link 1</a> <ul><li><a>link 1</a></li></ul> </li> </ul> I am using the following JS to use hover and show child menus. I want to add delay to the mouse out function (when the class of the LI removed) about 500ms, $('li').hover(function(){ $(this).addClass('over'); }, function(){ $(t...

XMLHttpRequest request is resultin in ReadyState 4 and status is 200.

I am trying to make a XMLHttpRequest Request to a content which is on local, runnin on local webserver from a HTML File and javascript residing locally. it will hit the webserver request, and then even thou it sends the data back, in my javscript, at once I get readyState 4 and status as 0. If i try putting the pages in the webserver f...

Why does typeof NaN return 'number'?

Just out of curiosity. It doesn't seem very logical that typeof NaN is number. Just like NaN === NaN or NaN == NaN returning false, by the way. Is this one of the peculiarities of javascript, or would there be a reason for this? Edit: thanks for your answers. It's not an easy thing to get ones head around though. Reading answers and t...

Changing the dropdown list's value depending on textbox value.

Hello All, I m creating one web page having one textbox and one dropdown list with submit button. Now my problem is : When i ll enter text in a textbox depending on that text one sql query will run and it's result should be shown in drop down list. I tried with onchange,onClick function but it didn't worked. I m not getting exactly how...

Get links from a page and show them in a table?

I'd like to get the titles of some links on a webpage to show them in a table. The page links change a lot, so I don't know how to make the table "dynamic", to show the link titles correctly. Is this possible with JavaScript? ...

Is JSONRequest a global Javascript object ?

My goal is to asynchronously call a URL via POST request (REST Webservice) to increment a statistic on one of my object. I am a newby web developer and I discovered JSON yesterday. Since JSON seems a lot popular and handy I went to www.json.org and discovered a JSONRequest object which seems to able one to send POST/GET request asynchro...

Event firing sequence for a submit button.

Say a submit button has a click event handler as well (yes, it's wrong, but that's really the code I'm working on). And the click handler sets a value in a field of the form that's about to be submitted. So when the submit button is clicked: What will fire first, the form submit event or the click event? Will the value set in the for...

How do I create a custom text field in Tapestry5 that renders some Javascript onto the page?

I have been trying to create a custom textfield in tapestry which will render some javascript when it gains focus. But I have been having trouble trying to find an example of this. Here is some of the code i have started off with: package asc.components; import org.apache.tapestry5.ComponentResources; import org.apache.tapestry5.Field...

Replacing strings with regex in JavaScript

A particular regular expression is bugging me right now. I simply want to replace the range=100 in a string like var string = '...commonstringblabla<b>&range=100&</b>stringandsoon...'; with ...commonstringblabla<b>&range=400&</b>stringandsoon... I successfully matched the "range=100"-part with alert( string.match(/range=100/) ...

XML XHR Request resultin in 0 stauts and empty response text.

I had another post for the same problem... I think I put the question in a wrong way.. Let me give more details: i have test.html in my c:\ drive and I have a local webserver runnin in qt, and i have some plugin written to that webserver which will get the request and send some response text "hello". in test.html i m making a xml xhr re...