var MyTable = new Array (
// english , italian ,Qty
["WaterMelon", "Anguria"],0,
[code]....
Now i'm building a page with a "SELECT" control for each entry in that table.Each SELECT changes the Qty value of the table.I need to show the table sorted alphabetically but depending on the choosen language the order will change, so i can't rely on the "index" of the changed control to find out what row in the table i need to modify.How can i sort that table and still have an association between the sorted indexes and the table original indexes?
I must insert in my standard html tables, the possibility to sort/filter columns.... in excel style, like this.There is a plugin that allows you to make this thing?
I am using the excellent jquery.tablesorter successfully for a large number of 40-row tables that live together on one page. So far I'm very happy with the plugin. My users also need the ability to apply any column sort they invoke automatically to *all* tables on the pae. They do not wish to sort the tables individually. As recommended in another thread, I have been looking at sortStart and sortEnd, but have been pulling my hair out trying to get this working. My JS:
<script type="text/javascript" charset="utf-8"> $(document).ready(function() { // extend the default setting to always sort on the first column $.tablesorter.defaults.sortList = [[0,0]];
I have encoded same javascript file with "Microsoft script encode" and accidentally deleted the original file.There is a way to convert the encoded file into the original version.. The form of the encoded file is : <script type="text/jscript.encode">#@~^.....
OK so Ive been using jquery for a little bit now and love it. I am a ColdFusion developer. I have a need where I would like to present the user with a list of categories and the user can drag and drop to sort, but then I need to post this new sort order to the database. So I see there are a ton of cool drag & drop plugins for jquery. I understand how they work and I can get it to work as far as spitting out DIVS or spitting out ULs that can be sorted, but then what? So now they are sorted on my screen and not really part of the form. How do I translate that into something I can do a post to the database with? Do I do an AJAX call every time they drop an item and try to extrapolate the sort order on that item after they drop it? Do I populate a hidden form field with the constantly updating sort order list? MAybe a list of ID's? How does everyone else go about this this task? I'm sure there is more than one way and I'm sure this is a common task.
I have the below array called "results". When I loop through all document elements I would like to check "field_name" against the "results" array and see if it exists and what index number it is at??
// Split the comma delimited response into an array results = result.split("~"); //Loop through array and populate fields[code].....
I am trying to get the index of a li with a specific class. I know I'm selecting the right object because I can apply a CSS class to it (eg change border colour) but when I try to get the index it returns -1. But I know the object exists as I can alter it. :-s
jQuery(document).ready(function() { var active = $("#tertiarynavigation .bordered").get(0); var num = $("#tertiarynavigation li").index(active); alert("Index: " + num);
I have a problem with layers. In my example there's a link inside div#msg with 'z-index:1' and a overlay with 'z-index:2'. Now when "mousedown" fires, will change the div#msg z-index value from 1 to 3 to be on Top, so the link become a clickable link.
The question is, it is possible to make the link on top and open it with just one click?
I'm trying to access the source of an HTML page with as few alterations from the actual source (as in, that seen from the View Source option) as I can. The method document.documentElement.innerHTML returns the HTML source, but adds HEAD and other elements if they are absent from the source, and takes out whitespace (i.e., line feeds, carriage returns and tabs) within tags and between tags. The follow function:
function xhr() {
xhr = new XMLHttpRequest() xhr.open("GET","test-page.html",true); xhr.onreadystatechange = function() { if (xhr.readyState==4) { alert(xhr.responseText); } } xhr.send(null) }
doesn't add or alter any tags that are absent in the source, and does not take out line feeds within tags; it does, however, still take out all non-line-feed whitespace within tags and all whitespace in general between tags.
It seems that preserving whitespace is all that I need, but I haven't found a way to do that through my searches. So is there any way to get the unaltered HTML source of a page without innerHTML or applets, like a better version of the XMLHttpRequest object's responseText method?
I am using a pre-built javascript DatePicker. It uses window.open to display the Calendar and works fine if the user clicks on a link for a specific date. The proper textbox in the parent window form is populated and the DatePicker closes.
The problem is when a user clicks on the parent window, the datepicker is hidden behind the parent window. Beleieve it or not, this creates a real problem for many users.
Is there any way to put up an alert to the user and then set focus back to the datepicker if the user clicks on the parent window by mistake?
In the datepicker.js there is a reference to the window created:
ggwindow = window.open(..parameters)
So I tried something like ggwindow.onblur=dont_close_me() referring to a function that displays an Alert and then sets focus back to the datepicker window. I know that onblur is an event and not a property or method of the Window object, but I have also seen mentioned that the onblur event can be applied to the Window object.
During window creation I don't see a way to set the onblur event for the created window.
I need to keep a log in a test application, so I'm using a textarea for that, and I'm appending text using the+= operator.Follows the trace function which fills the textarea:
window.trace = function(s) { if ($('#enableLogCheckBox').attr("checked")) { var logArea = $('#logArea')[0];
I've noticed that if you declare a variable in one function, then call another function, the variables cannot be accessed in that function. Is there any way to get the value of a variable declared in a different function?
Ok first the bad, it will not work from a stylesheet, you have to use style="display:none" all over the place, I will try to fix that without adding more than 2 lines to the script somehow, I hope. you can not have line breaks in the innerHtml statements in your links(I think that's normal anyway). javascript:void(0); will not work for an iframe, you have to use #(or #null to keep from clicking up to the top of the page) for the hrefs, I don't know if that is a bad thing or not, there has to be something better than both of those options. now the good, if you do not have access to the head of a page, everything works from the body of a page. it is good for making ul/ol tags for a vertical menu without that complicated scripting having to differentiate ul/ol text and li links in those scripts for just a simple menu, the ecmascriptmenu is the only one that makes sense to me, hope he gets his server fixed. the script seems to work with or without a doctype in IE6 firefox and safari. people always wonder why I try to make these type of scripts, I usually maintain long lists of links so I like to provide small previews(iframes that do not load until clicked) for each link, the best part is that IE firefox and safari react to it flawlessly unlike most other types of scripting, one script had an eval statement that gave me tons of trouble taking it out and the other script I took out a server sql proprietary call to a rowid for a table and made almost any html element be a target(a p tag for instance). here at :
i have developed an application that allows users to post code on their profile on various social networks, and activate the application by submitting data via an html form from within their profile. the application works fine.the form action is processed on my server the problem is that after they submit the form, the users are directed to my website and the display of the results are presented on my website - at hxxp/xxxxxxxx.com/process.php.
i am trying to keep the users on their profile on their social network. i tried unsuccessfully using targret="_self" and target="_blank" as part of the code they are posting on their profile I am trying to figure out a way that they will not be directed back to my website.
here is the way the code posted on the users profile on their social network looks like:
I have a menu with a horizontal submenu. What I want is for the submenu to stay active if the mainmenu link is activated... This I got so far. Now what I cant figure out is how to make the active submenu hide when hovering over the other mainmenu links... And show again when not hovering...
Here is what I have tryid so far:
Code CSS: #navbar { top: 0; left: 0;
[code]...
Now this allmost does the part except hidding the active submenu when hovering...
What I would like to achieve is that when a user goes back to the first page that his/her selection of the cities is still available. All items that have been selected are in the right hand box. This list is again empty when they return to this page via the "history.go(-1)" link.
The page is in dev status and in german, but it is very easy to understand, so it shouldn't be any problem for you guys. The javascript code can be seen in the source code on the first page. The left list is filled with a mySQL statement in the first place.
Of course I can to some PHP workaround by evaluating the submitted variables, but this would be much more work. I want to know if there is an easier approach? Code:
Here's my HTML code. What I'm trying to do is when the button is pushed to refresh the popup window information, I want the popup to return to the front. The way my code is now, when refreshed the popup stays in the background confusing the users.....
Assuming I have the functions, "isNumber" and "isEmpty", how would I write the HTML INPUT type="text" element such that a person cannot exit the element unless they have typed in a valid number (as defined by the function isNumber) or left the field empty (as defined by isEmpty)? Thus, if they have typed in "aaa" and then pressed "Tab" to go the next element, they'd get a warning message, and be returned to the old element?
Ideally, this solution would work for both the latest versions of Firefox and IE.
I'd like to know if there is a way to keep a table header fixed on top of a div while I scroll the table rows. I have a div high 200px and the table itself is around 300px so when I scroll down I'd like to always see the header on top. I already use for the table tablesorter so the solution must be compatible with that plug-in.
I have around 30 check boxes in a form and I need to keep track of their status if they are checked or not and based on that change the data in the dom.
I am stuck on the logic of how to implement or code for 30 check boxes. I was using the below example code but there will be a lot of if statements as I need to always know what their status is. Is there a better way I can manage so many check boxes ?
Right now, I have multiple draggable windows on my site. The problem is, that only the most recently created box is draggable and I clicking the other box doesn't work.
Where you can click and drag different boxes. The problem is I don't know how to implement this. When the two boxes are up and I click on one box, it completly ignores the other box. I realize in my code I need to update widget1 but I'm not entirely sure how I can do that. I call the method below using: document.onmousedown=selectMouse; in my javascript
If it helps, the windows are all contained in a <div> tag with the id 'closewid' Each of the new windows that opens had the id "widget"+a number.
I have a complex form and a 'Print' button which should print only the contents of a specific DIV. I am using the following function (i found on another forum):
function PrintContent() { var DocumentContainer = document.getElementById('divName'); var WindowObject = window.open('', 'PrintWindow',
[code]....
While using this, the CSS styling of the DIV are missing.How can I print the DIV's contents and keep the CSS styling.Before using that function, I tried "execCommand("Print")" but the results weren't good at all. it printed only a small part of the content.
I need some code that prevents the contents of an iframe from loading outside their source. Namely, the page has its main text content in an iframe so it can be scrolled through while keeping fixed size layouts. That iframe points to a file, content.html, that I want to keep the user from loading directly in the browser. I'd like it so, if they do go to content.html directly, it will just boot them back to the main index.