this is driving me nuts. I'm not new to programming, except that I've been avoiding Javascript for long time and now it's biting me back.
I have form in which I have among other element a series of checkboxes. These have different id, and values but same name attributes. These attributes are populated with good old ASP spaghetti code.
When I check the box, I want a Div tag called "floatleyer" to populate with a duplicate checkbox and it's value ( a string). So now we have pair of check boxes one the page and a matching one in the div area. If you un-check either box of the matching pair the other member of the given pair gets un-checked as well. In addition, the box and value string from the floatleyer is completely removed.
I have created a floating layer using Javascript that remains always on top of page on scrolling.Issue is,at some point while scrolling,the layer flickers continuously.
The html page is as follows:
Many common software systems, JavaScript has a history of security problems. Many of these problems could allow a person with malevolent intent to steal sensitive information from a visitor. The number and type of such holes in security vary among browsers and operating system versions. Most JavaScript security holes have been caught and fixed, but new ones are being discovered all the time. For a list of current security holes check out your browser's and operating system's Web pages. As a Web site author, it is your responsibility to keep up-to-date on the current status of known security holes in the applications you create.
Signing Scripts. In Chapter 11, I explained that JavaScript does not provide the ability to directly access files on the client computer. This can be a very large hurdle to overcome if you're trying to upload a file to a server from the client computer. Fortunately, file uploading is one of many functional enhancements that signed scripts provide. Signed scripts are specially packaged scripts that have been verified and signed to be correct and non-threatening. These scripts have additional rights on the client computer that allow a programmer to do many things that he wouldn't otherwise be able to.
With the introduction of Netscape 4.0, a new security model was put in place that would allow digitally signed scripts to bypass some of the restrictions that had previously been placed on them. A signed script can request expanded privileges from the visitor and, with the visitor's permission, gain access to restricted data. A signed script requests these additional permissions through LiveConnect, which allows your JavaScript code to communicate with the Java Capabilities API. The security model allows JavaScript to access certain classes in Java in order to extend its functionality while still maintaining tight security for the client.
A digital signature is a fingerprint of the original programmer, and it allows the security model of the browser to detect where (or from whom) it originated. A script signer can be a person or an organization. By signing a script, you acknowledge yourself as the author and accept responsibility for the program's actions. A signed script contains a cryptographic checksum, which is just a special value that ensures the signed script has not been changed. When a digital signature is detected, you are assured that the code has not been tampered with since the programmer signed it.
Once you finish writing a script, you can use the Netscape Signing Tool to digitally sign it. Signing a script does the following:
Unambiguously assigns ownership of the script to a person or organization.
Allows an HTML page to use multiple signed scripts.
Places the signed script into a Java Archive (JAR) file.
Places the source of the script in the JAR file.
Once a user confirms the origin of the script and is assured that it has not been tampered with since its signing, he or she can then decide whether to grant the privileges requested by the script based on the validated identity of the certificate owner and validated integrity of the script.
JAVASCRIPT FILE IS AS FOLLOWS:
AND CSS FILE IS AS FOLLOWS:
At some point while scrolling,the div 'movable' flickers continuously,while at some other point,it is perfectly stable.
How would I go about simply populating an HTML select statement from a JavaScript function. You see I have several HTML select statements on one page which are identical (sometimes repeated multiple times) so I wanted to try and cut down on these multiple instances and just have the values hard coded once (in a JavaScript function perhaps) and then called whenever they are needed. Could anyone advice me please, would this be easy to do?
I have the following HTML select statement hard coded:
I have a table set up with a .click() function on each row sothat if it is clicked on, a class is added to the row thus changingthe background, etc. I was wondering if there was is a way to takethe id of the row that was clicked and populate a hidden field withit. What would I need to include in my .click() function for this towork?Here is my current one:
I have 2 things going on here. One, the 'percent' variable is constantly showing up as NaN (not a number) no matter what numbers I give it. I suspect it is happening because the function is populating all the fields at one, which causes a 'divide by zero' scenario for the percentage field, which is last in line. Which brings me to my send thing. How to write this function correctly, as it obviously is causing problems as is, and it seems clunky. I think it should broken up into a couple different functions, but I tried that and NOTHING worked.
Here is the code, let me kow what you think: function calculate(){ var contractsAdded = document.forms[0].contractsAdded.value; var priceAdded = document.forms[0].priceAdded.value; var contractsSold = document.forms[0].contractsSold.value; var priceSold = document.forms[0].priceSold.value; var totalAdded = (contractsAdded * priceAdded) * 100; var totalSold = (contractsSold * priceSold) * 100; var gainLoss = totalSold - totalAdded; var percent = gainLoss / totalAdded;
I'm only new to Jquery and Ajax for that matter, understand JavaScript but don't work with it everyday. I have a function from Jcarousel that is populating a div with images (talking to a .txt file which contains the url), JavaScript then writes out the image. function getItemHTML(data){ var split = data.split(";"); var url = jQuery.trim(split[0]); var title = jQuery.trim(split[1]); var url_m = url.replace(/_s.jpg/g, '_m.jpg'); return '<a href="' + url_m + '" title="' + title + '" class="thickbox"><img src="' + url + '" width="' + 75 + ' " height="' + 75 + '" alt="' + title + '" /></a>'; };
And this is the function talking to the datasource function loadItemHandler(carousel, start, last, available){ if (available) { // Trigger loaded carousel.loaded(); return; }var cr = carousel; jQuery.get("example_dynamic_ajax.txt", function(data) { appendItemCallback(cr, start, last, data); });}; Now what I would like to do is instead of populating with images from .txt file I would like to populate with code from another .html page (a html page containing a table code). I'm just not entirely sure what object I need to use and how to go about that. Full code that I am working with is here: [URL].
I am trying to populate a listbox using Javascript. The listbox is populated using the xml response from ajax request. But i am facing performance issue here. some ajax requests retrieves xmls with around 11,000 nodes and this takes too much of time to populate the listbox.
Am trying to populate my second list box from the 1st. I have done the folowing code, iam trying to call a function in the onchange event of my 1st listbox, but it does not change the URL :( however if i manually change my URL then the thing works fine.
I am trying to make a banner the size of the with of my screeen, in a layer.
BUt I also want to fade it to a complete transperency to reveal the contents of what's behind it (my page ofcourse) and possible close or hide the faded layer.
I've seen stuff like that happen in a flash everonment. I was thinking about using a transition at first to go from one page to another with an introductory page.
But I rather have everything on one page and just fade the introdutory layer into the page. Is that too much work for jscript?
I have a strange behaviour when applying onmouseout to a layer. it is not trigged when the pointer goes out of the _layer_ but when it goes off the _text within_ the layer.
I want to create a layer that 100% wide, 200 px high and stays at the bottom of the screen, even when the page is scrolled, how do I do this? I have seen it on websites but can't find any example code ...
I have written a javascript routine that populates a parent document with a series of <iframe>s. Each <iframe> receives its contents from a series of separate smaller HTML files. Of course my NN 4.8 browser doesn't deal well with the <iframe> so I wrapped the code that generates the <iframe> in <ilayer> tags. NN now recognizes the contents.
However within each of the 'content' files I have another javascript routine that basically displays the file name (via document.URL & document.write) of the content file. My IE 5.5 & Mozilla 1.5 understands this perfectly. However my NN responds to the document.URL with the wrapper/parent document's URL, not it's own unique file name.
I've named/ID'd the iframes & ilayers. If the document.URL fails I can still make use of the ilayer ID but I need to know the index into the layers array. I can hard-code a index value into the document.layers[x].name but given that the position of the particular content file is dynamic within the parent, the index is going to be wrong 9 out of 10 times. There doesn't seem to any way for an i/layer to know who it is Code:
I want a scrolling JS layer (not CSS) am trying to fit it into an already existing site design which the client doesn't want to change. It works fine when i try it on a new page but the moment I put it into my actual page where it has to fit into a particular are (I used the overflow: hidden it doesn't behave!!
I have to write a web page wht three combo boxes, all three are to be populated from a database. - there tables = Bulidings, Floors and Offices
The user will choose a 'Building' from the first combo, once it has been selected, I need to populate the second combo box with the 'floors' of that selected building. The user will then select the floor, which in turn will then populate the office combo box for the user to select.
I'm basically building a javascript/html calculator but I need the calculation to appear gradually in a table, the table need to be 3 columns accross and add a row each time a calculation button is pressed, the first column can remain blank for now but will need to contain a text field eventually, second column needs to show the calculation symbol, third column shows the number. Here's an example:
Wonder if anyone can help. I have a page on my website where users can select their country and state/province from a drop down menu. The country and state/province drop down menus get populated from the mysql database using javascript: ie: the user select his country, and the states/provinces of that selected country is then populated into the drop down menu. The code looks like this:<select name="countryList" id="countryList" onChange="return CountryListOnChange()">So the js part onChange will only populate the states drop down menu when a new country is selected.Now the problem is: when the use goes back to his profile, he can see the country he selected, but not any state, since the states list is only populated onChange.
I am having a hard time figuring this out, I have two simple arrays and I want to populate one by asking a visitor to enter information, it goes something like this...
var country = new Array(5); c_list[0] = "USA"; c_list[1] = "UK"; c_list[2] = "France"; c_list[3] = "Germany";
[Code]....
how do I use a simple for loop to use the names entered and populate the second array?
I've been working on a listbox full of employees for our company intranet. Each name has an onchange tag that calls up a floor map and that part works fine but I'd really like to populate the names from an XML list so it's easier for non-IT people to maintain.I've been doing alot of web searches on the subject which comes up alot but it's mostly just fragments of what I need being that I've got no javascript background.I found a helpful tutorial on javascriptkit but that wasn't for creating listboxes so I'm only part of the way there. The most important parts are the name which will be used as the text of the box and the office number which will determine which floorplan is displayed.I added the other information so I can potentially put it in a div display later but that can wait.
I have a problem here with my coding. I want to have three levels combo box. However the second level is not populating the values, therefore the third level cannot be populated also. I have attcached my codes here. Pls have a look and tell me where is my error.
I'm trying to create a simple birthDate form. Depending on the month selected, it will populate the days field. Then once the day is selected it will populate the years field.
I want the years to start @ 2008 and end @ 1900. But I cant get the count to stop at 1900, it will go right down to 1. Can someone take a look at my populateYears() function and see where I have gone wrong? Code: