I have a project that I need to read some data from an XML file.
Something like:
However, since JS is a client side script so it can't read from client side, is there any alternate way to do this? I am thinking to create a "Data" class, and many "Data" objects, is this an elegant way to do it?
I am trying to create a form which when the submit button is selected will open a new window with 1 of 4 URLs based on the the combination of data in 2 select boxes.
I am trying to use jQuery AJAX. What my requirement is, i wish to load user names from DB in dataset, convert it to JSON format and store it in memory or using jQuery data for use while a user is browsing my site, i.e for a session. This way I can use autocomplete or my own code to display data to user.
My table is a data table, and I'm contemplating using it as the data store as well, rather than keep a js array of data separately. The cell values are retrieved by ajax, then inserted into the table. I'm thinking that the duplication of data (once in the js array, once in the table) is likely to lead to strange results somewhere along the line, where the two data sets get out of synch. It seems to me that jquery makes using a table in this way rather simple (I refer to the jquery selectors in particular). The table includes some editable-in-place columns.
If any such edits, and user presses a Save button above the table, the save function finds the edited fields and sends an appropriate ajax call, then refreshes the table with the outcome (eg it worked, so new values remain shown, it didn't work, revert, or something like that, it's not too important here). Hence the need to maintain some 'awareness' of the values in the cells. I'm content with using attributes as needed to support this (e.g., to be able to revert to original value, to mark cells that have been edited). Table may contain up to 500 rows, ten columns. How it compares with keeping the data in a js array?
I am using jquery to make a dialog box that take user info. I want to store that info and upload it to an sql database later. So far this is what i have.
<code>
When i run this i get:
Control 'ctl00' of type 'HiddenField' must be placed inside a form tag with runat=server.
I've gone back and forth on the best way to store data in HTML elements which is used to support JavaScript. For instance, I might have a bunch of rows each associated with a SQL ID, and upon clicking the delete element, want to grab the id, and send it to the server. I've successfully used the following three solutions, but would like to standardize on just the best.
Option 1 is technically valid, but seems excessive. Option 2 will work fine, but is considered by some as bad practice. Option 3 requires the extra step of splitting the ID from some identifier string, and care not to have the same record twice on the page.
I wanted to define additional attribute to a tag to manage information. I realized that XHTML might not like it and discovered the data(name,value) function. I was wondering how I could retrieve all tags e.g. "div" that have that data variable set.
I have a simple count-as-you click button form, and this is what I want to do with it:
Click the button (however many times) to get the sets of numerical data.Take those numbers into a cookie, and be able to add/subtract to each number as i use the form again; and update the cookie. I need a way to be able to do this multiple if not an infinite number of times!
I've been using localStorage to store a large amount of data (> 5mb). I know that most browsers limit localStorage to 5mb. However, on the specification site it states,
Quote:
User agents may prompt the user when quotas are reached, allowing the user to grant a site more space. This enables sites to store many user-created documents on the user's computer, for instance.
Now lets assume that the text itself contains characters outside of the normal ISO-8859-1 character set (like asian or russian characters). Would the individual char values be stored as one byte or two bytes?
"hello" -> 5 * 1 bytes = 5 (normal 8859 character sets) "hello" -> 5 * 2 bytes = 10 (unicode or an extended character set size).
Is ISO-8859-1 still stored like ASCII once was as 8 bits? Or is it 16? If I was to use a 2 byte character set then would that cut the size of my allocated local storage space by half?
I have an object with a single Method to load content from a xml file. The problem is... how do I add a property to the object to store the data loaded?? I tryed adding a simple Array inside the object, but didn't work.
I am generating a html based table with multiple rows of data coming in real time from a postgres DB. The underlying technology is java based however the front end is html.
now i am unable to alternate the colour of every row so that the table is lot more readable. can anyone suggest a javascript or even a css script which will alternate the row colours irrespective of the number of rows.
window.onbeforeunload = null; window.onbeforeunload = confirmExit; var executingPostBack = false;
function confirmExit() { if ( typeof executingPostBack != 'undefined' && !executingPostBack) { return 'Warning: Modified data has not been saved.' ; } }
In some cases, IE pops up it twice, for example, when we click a link that contains "__doPostBack", onbeforeunload is fired the first time; when the form is submitted, it is fired second time.
There is no way to work it around, because onbeforeunload is stupid, we can't know whether the user clicks OK or Cancel.
I would like to use the following code with confirm so that I know exactly what the user behaves
res = confirm("leaving?"); if (res==1) { alert("yes"); } else { alert("no"); }
but I can't use this in onbeforeunload, because I can't stop it! onbeforeunload always asks for something return, but if I return anything, it will popup!
I am making a ajax form request and I am clueless on how to make an alternate submit when javascript is disabled. This is so it works without javascript and uses a separate php file.
I currently have some simple JS setup but I'd like to alternate between 2 values using "onclick". I have setup a flash clip with a form input buttons for playback control. Here is my form:
However, once this intial stage has passed, and the button is clicked again - the image needs to revert back to the "play" button - so its a cause of having the pause button on show whilst the video plays, if its then clicked, the play button shows as the video is paused.
For a lot of years now I've used a javascript that does a simple rollover image swap, but also changes another alternate image at the same time. It's always worked like a charm.Lately I realized that the script no longer works in IE, though it used to in older versions of IE (I think it stopped working in anything past IE 7). It still works fine in Firefox, Safari, etc.I haven't been able to find a good alternative for this script, so I'm really trying to get it to work again in IE, but so far no luck.
Here's the link to the actual script itself. http:[ur;l]....
Here is a quick menu hidden in a Mouse Gesture for additional navigation on a site or administraitive duties.
To activate the menu simply right click anywhere on the screen , hold the button down, then move the mouse down 50px's and release. This will display the hidden menu.
There are two parts to it, first the Style and Script....
<style> .expanded { position:absolute; padding:1px; font:Arial, Helvetica, sans-serif; font-size:11px; text-align:left; background-color:#D4D0C8; width:150px; border-left :2px solid #FFFFFF; border-top :2px solid #FFFFFF; border-right :2px solid #999999; border-bottom : 2px solid #999999; } a.expanda { padding-left:15px; padding-right:15px; display:block; text-decoration:none; color:#000000; } a.expanda:hover { background-color:#003366; color:#FFFFFF; } </style> <script language="javascript"> document.oncontextmenu = null; document.onmousedown = doDown; document.onmouseup = doUp; var timerID = 1; var ly; var ny; var targ; function doDown(e) { clearTimeout(timerID); document.oncontextmenu = null; var rightclick; if (!e) e = window.event if (e.which) rightclick = (e.which == 3); else if (e.button) rightclick = (e.button == 2); try { if (e.target) targ = e.target.getAttribute('id'); else if (e.srcElement) targ = e.srcElement.getAttribute('id'); if (targ != "navlink") {document.getElementById('altnav').style.display = 'none'} } catch(e) { document.getElementById('altnav').style.display = 'none' } if (rightclick != false) { ly = e.clientY; } return false; }
function doUp(e) { var rightclick; if (!e) e = window.event if (e.which) rightclick = (e.which == 3); else if (e.button) rightclick = (e.button == 2); if (rightclick != false) { if (!e) var e = window.event; ny=e.clientY; lytemp = ly+50; if (ny>lytemp) { document.getElementById('altnav').style.display = "block"; document.getElementById('altnav').style.left = e.clientX + 2; document.getElementById('altnav').style.top = ly+2; window.status = "down menu"; document.oncontextmenu = fakecontext; timerID = setTimeout("document.getElementById('altnav').style.display = 'none'", 5000); } } ly = null; ny = null; } function fakecontext(){return false;}; </script>
And the menu div to place inside the body tag. Edit this to act as the menu you would like. Remember that you can access the event.target if you want to have the menu dynamicaly effect things based on whats clicked.
I was actually looking for a couple of alternate form field elements such as a drag bar or combo boxes. Is there something like that out there, even? (see ascii representation for example of what I mean) Code:
There are lots of JavaScripts and PHP scripts for making tables with alternating row colors. I'd like to know if there's a way to use JavaScript to give a table alternate row CLASSES.
My ultimate goal is to cut down on the html and gain more control over my table. I have a PHP script that gives me alternate cell colors, with different colors in each of two table columns. But it's just too complex to work with. Code:
I am building a display which is made up of a XHTML table, CSS styling and JS animation.
The effect I am looking for is for the (mutliple) cell's content to alternate between one word to another.
My initial idea was to build an array to count through the cell numbers like I have for another section of the board in this snippet..
var flsh = document.getElementsByTagName('td'); for (var i=0;i<flsh.length;i++); //flash alert cells { cell = !cell;
[Code]....
This code flashes some of the other cells each second, however for my alternating text I'm not sure what methods to use since .style.backroundColor wont suit this.
Basically i have a function that depending on which picture you click (one for "yes" and other for "no") it will make visible a textarea .
However right now if i click in "yes" it will display me the textarea for yes, and afterwards if i click "no" it will display both textareas, for yes and no. I want everytime i click on yes it will hide the "no" textarea and the same for when i click the "no" textarea, it will hide the "yes" textarea.
I am a little new to java script and jQuery so, if you can, please ignore my ignorance. I am creating a theme for Joomla and am calling in the website title using php. I would like so that every other word is a different color.
[Code]...
I would like to use jQuery to make every other word a different color in that specific span.