javascript

dynamic table row creation in html/Javascript

hi, I have html table with 1 row to fill in job details for a position.Now If a user wants to fill in job details for another position,on clicking a link, a new row should be created dynamically each time the user clicks the link.Can any one please help me with the code in html I'm using frontpage. Thanks, Vix ...

javascript, php, cookies

When i declare mac = 123, my internet explorer and firefox will keep refresh non-stop. And if i declare mac = getMacAddress it returns a value 1... I'm able to do a document.write(getMacAddress()) and it would able to display the mac address nicely. 1) Why my explorer will keep refreshing non-stop when i code it manually with "123" 2)...

Using jQuery, how can I get an image to open full screen to the browser's height and width?

I'd like to create a jQuery function that accepts an image url, and when executed, displays the image full screen matching the height and width of the current page. Thanks. ...

JavaScript: refactoring, avoiding array.push()

I've got a function in an object like this: arrayofElements: function(item) { var result = []; if (item.isA) { result.push(new Div('aClass', labels['A'])); } if (item.isC) { result.push(new Div('cClass', labels['C'])); } if (item.isD) { result.push(new Div('dClass', labels['D'])); ...

Hit-testing SVG shapes?

Hi, The browsers which have implemented parts of the SVG spec (Firefox etc) do hit-testing for us for free - if I attach a mousedown listener on an SVG object, I get notified whenever the shape is clicked. This is amazing, especially for complex polygon shapes. I'm wondering if there's a way I can utilize this feature for a bit more hi...

How can I get Firebug to step-through inline javascript code?

When my javascript code is contained in a HEAD block in my HTML file, it seems I can't set a breakpoint on it to debug it. How can I do this? this is what I see under the script tag: Odd: when I take the javascript block OUT of my HTML <head> area, then the .htm page appears under scripts (kind of counter-productive): ok, t...

Help with JavaScript scope

I fear I may be losing my marbles today, because I don't know how to do what I want to. I want a custom prompt that I can call from any of my other JavaScript functions. I don't know how to get this work, even though it feels like I've done it a hundred times. Here is an example var modal = function() { var prompt = function(msg) ...

remove tags which javascript returns with the text

here's my function function getInfo(Description) { return Description; } here Description has <p>Info Summary:<span>2.26PM</span> InfoADDED</p> now, i want to eliminate html tags before returning the 'Description' pls. help ...

Some javascript (an input) isn't working in IE only....

I've got some code that works great in FireFox, but in IE, the input doesn't work. The text at the beginning there comes out just fine ("track number 1", etc), but the input just doesn't seem to exist... I've been racking my brain trying to figure this stupid thing out and can't get anywhere! The code is executed simply by clicking a but...

Check/ Uncheck all checkbox of a Html Table

i have got a HTML table which contain a check box in and other checkboxes in i want that all 's checkboxes should be checked /unchecked on basis of 's Check box... please help me resolve this... i wrote follwoing code. but its not working.. <script language="javascript" type="text/javascript"> function SelectAll(id) { var f...

code for giving ratings

hi friends, I want to give some type of ratings to my posts in my site. i want to do this coding some like the below site http://www.comminit.com/en/node/222010/2754 i want to do this type of ratings in my site. Does any one have code to do this. or any one can tell from where i can download such type of codes... ...

Storing a function with jQuery data() method

The jQuery .data() documentation says the following: The .data() method allows us to attach data of any type to DOM element I assume "any type" refers to functions as well. Say I have a div with the id foo as such: <div id="foo">Foo!</div> And I'd like to store a function in it called say that takes a parameter. According to the do...

Manipulating Javascript RegExp results as non-strings

It's much easier to show the Javascript code than offer a complex explanation: var html = '<input tabindex="1" type="text">'; html.replace(/tabindex="([0-9]+)"/g, 'tabindex="' + ("$1" * i) + '"'); In this code, "$1" will always be a string, meaning this RegExp will always result in 'tabindex="NaN"' ... Using parseInt doesn't work. Is...

Prototype Event.observe not seeing AJAX-returned HTML

I'm trying to create a CMS system based on AJAX using Prototype's library. On a page load, I have HTML, page title and additional Javascript for the page returned via JSON, and I update the HTML on the main area. I also have an event listener that listens for certain ID's to be clicked on. The listener is working, var TabMenu = { sel...

JavaScript expression to generate a 5-digit number in every case

Hey, for my selenium tests i need an value provider to get a 5-digit number in every case. The problem with javascript is that the api of Math.random only supports the genration of an 0. starting float. So it has to be between 10000 and 99999. So it would be easy if it would only generates 0.10000 and higher, but it also generates 0.01...

Is there a NotReadyFunction in jQuery?

Hi, Is it possible to check if the document is not ready and execute a function periodically in jQuery? Simply I would like to achieve something like : $('document').isNotReady(function(){ $('#divState').text('Still Loading'); }); $('document').Ready(function(){ $('#divState').text('Loaded'); }); Is there a built-in fun...

ASP.NET, combining conditionally included script files

We are working on an ASP.NET CMS project using jQuery as the basis for our client side scripting. The jquery-1.2.6.js file is the only script file that is always included. Other script files are currently included depending on what components the CMS editor is using on a page or page template. A lot of the script combiners produce a s...

create a chat application in php

im tryig to create a chat system using php and javascript .i wonder how the chat in gmail works, will will remain in the same position even if we are going through dirrerent pages.it will be greatful if anyone clan explain me how it works. And at the same time please give some ideas to create a chat s/m, like creation f the popup window...

Date manipulations in Javascript

Hi All, I am using a dropdownlist and a calendar control in my page. In that I am having following list items. 1)Last Week 2)last month If I choose last week in the dropdownlist the calendar control should display the date range from date 7 days ago and today's date. How can I get it through Java Script ...

Detect when window vertical scrollbar appears

Is there a simple and reliable solution for detecting window vertical scrollbar appears/disappears? window.onresize isn't triggered when after JavaScript DOM manipulation page becomes high enough for appearing scrollbar. In this very similar post Detect if a page has a vertical scrollbar described solution how to detect whether scrollb...