Is there an option that can tell me if a datepicker is open or not?It could be interesting if this option can be used anywhere in my javascript code (aka in highlight of validate)
I am using jquery accordion where multiple accordions can be opened by user. I added onclick event to that adds source to an iframe within that accordion when user clicks on it. However I want to only load the source into the iframe when an accordion is opened...currently I load the source into the iframe even if they close the accordion.Example:<div id="toggleboxes" nclick="loadIFrame('iframe${iframe}','${mstrObject.firstChild.objectUrl}');">How can I determine if the onclick event on the above div is for open accordion action only?The code below returns object object. I am quite new to jquery and have been scratching my head for a bit regarding this. Does anyone know how to achieve this?I tried the following:var active = $( ".selector" ).accordion( "option", "active");Here is my loadIFrame function.
function loadIFrame(iframeId, reportUrl){ //getter var isActive = $( ".selector" ).accordion( "option", "active");
I would like to test if a particular input field has focus before allowing an event to take place. How can I do this, I tried using:
if ($('input#div_name').focus()) { do_something... }
But I guess many of you already know that in this case all it did was transfer focus to input#div_name - Which is not what I wanted to do - I wanted to only test if input#div_name had focus.
I have anunorderedlist with many list items several levels deep, some of which contain nested unordered lists. How can I determine whichindividuallist items contain nested lists and attach click events to only those list items? For example:
Level 1 and Level 1-2 should have the click event bound to them while all the other list items don't have anything bound to them. I assumed that I would loop over all the list items using each() and :has or .children(), but I couldn't figure out how to test if the list item I was iterating on contain a sublist.
Is there a clean way to determine that a page has finished loading? I have a page that basically imports photos from Facebook or something simliar to that and when it's done executing I'd like it to redirect automatically to a different page. If JS or jQuery isn't the best way to do this I'm ok with using something else as well.
I have searched Datepicker, the forums and the internet in general to find the way to determine the number of days between two dates using Datepicker. My inputs are named: Starts, Ends, Days. I found the code below, but cannot get it to work.
// calculates reservation duration function resDuration(#Starts, #Ends) { var date1 = new Date(#Starts.value); var date2 = new Date(#Ends.value); var minutes = 1000*60; var hours = minutes*60; var days = hours*24; var diff = Math.abs(date2.getTime() - date1.getTime()); return round(diff / days); } /* put that value in elapsed days field */ $('#Days').val(diff); I will then do validation on the result - input field "Days".
i just want to know if there is a way on how to determine if the images are fully loaded before resizing the images. I currently develop a slideshow that display images from the server. I just found out that if the images is not fully loaded it return wrong height and width. I just want to determine if the images are fully loaded before i resize it.Height and width is important to my application because i need it to adjust margin of the images.
I was editing some javascript code yesterday that happened to use jquery. Part of the code selected two elements via jquery. Then the original author used nodeIndex to determine the position of each of these nodes in their parents. I could not find any documentation on nodeIndex on the jQuery site or anywhere else on the internet. It seemed to work in IE8, but I did not see the property from FireBug in FireFox 3.5. So I removed the call to nodeIndex and used a for loop to calculate my own equivalent of the nodeIndex. Is nodeIndex officially supported or meant for internal use? Is it documented anywhere? [URL]
While using jQuery, I found that I needed to know how many records were returned and also if the result set returned was empty. After searching the jQuery documentation I couldn't find any property or method that returned this value, so I've added that functionality myself and wanted to share it with the group.
1) Determine the number of records returned: I wanted to show the user how many results were returned after they start typing into the autocomplete field similar to how Google indicates the number of results found when you start typing in the search box. At first I thought the max parameter in the function formatItem returned this value. However, it returns the max option that you set it to. So if your query returns 100 records and you set max to 25, it'll obviously return 25 (not what I wanted).So after trying various things, I looked at the jQuery code and simply added the number of records returned by the database to the formateItem function. In the fillList() function around line 660 I added the data.length parameter:
var formatted = options.formatItem(data[i].data, i+1, max, data [i].value, term, data.length);And in my autocomplete code, I added the parameter to the end of theparam list:formatItem: function(data, i, total, value, searchTerm, totalResults)So now whenever a new search is preformed, I get back the number ofsearch result from the database.
2) Determine if a result set returned was empty I wanted to update a <div> with a message like "no records found" whenever the query yielded no results. Again, after searching the jQuery documentation, I couldn't find any property or method that would indicate this so I added it to the code. In the request function after the line var data = cache.load(term); I added the following:
I've got an array of names, and one ID. I need to run an ajax call using the ID and each lastname, until I get a successful hit on the ajax call. I can't quite figure out how to determine if the function that runs the ajax call has succeeded or not, it always returns false for me... Here's the code for the loop:
I have a frame's onload event calling a function which needs to know which file was loaded. Is there any java object/method to determine the file name or any type of file id?
I know it's possible to retrieve the IP address of a visitor's computer. However, I need to figure out a way to get the IP address of the server where the files are placed. Here's a description of my issue:
My application, along with some HTML Electronic manuals, are loaded onto a server in an electronic classroom. In order to get to any of these items (manuals or app), the students access the server where an index page is located in the D drive and click a link to get to any of them.
The problem is that these manuals are loaded into the D: drive while my application, because it uses ASP, is saved in the C:inetpubwwwroot folder.
The other issue is that this application will not be placed in just one classroom. Each classroom will have its own server with any number of computers accessing it. Since I don't know how each of the servers will be set up, I need to get the IP address so I can access the wwwroot folder.
What I need to do is figure out, using some non-server-side language, what the IP address or computer name of the server is so that I can access the appropriate folder in the wwwroot folder.
This should be an easy one. I am using a single OnChange event with several <Select> statements, and need to identify the specific <Select> control that fired off the onchange event. I'm certain there must be a way to grab the ID or Name from the specific control in the javascript function, but I haven't been able to find it.
My spidey senses are telling me this can't be done without making an additional [XMLHttp] request, but ... Any way to read the redirected URL for an image? Suppose I have the following tag: HTML Code: <img src='/images/test.jpg' /> And suppose the image request redirects to /images/test.jpg?token=123. The image src, according to JavaScript is still /images/test.jpg. Any way to determine the new URL? (short of making an AJAX request for the image and reading the response header?)
I'm trying to get a value from a database, assign it to an innerHTML value of a certain element and display this on a web page. Here is how I do this. First I have a js function. Very simple one, here it is:
function get_page_contents(page_name) {$.post("includes/ajax.php?mode=get_page", {pagename: page_name}, function(data) { $('#hed1').html(data.h1); $('#content').html(data.content);
[Code]...
This javascript function is being invoked upon clicking on a link. The point is that the content's innerHTML is displayed beautiful while I cannot see H1 innerHTML. Its value is NULL instead of expected database value.
Is there anyway to determine if a DIV with its overflow style set to auto has the scrollbars visible? I have a dynamically built table inside my DIV. If the table is over a certain height and the scrollbars appear, I want to shrink the width of my table. If the table's height doesn't exceed the div's height, I want the table to be the same width as the div. Any ideas?
I have a script that will set the focus to a particular input box. I want the script to check to see if the input box exist also.
I'm receiving the following error: 'document.ScheduleForm.txtGrossPayroll99' is null or not an object.
The txtGrossPayroll99 is a field that does not exist. I've hard-coded this name into the script to see if it is working correctly. I'm using the OnLoad event inside the <Body> tag to execute this function.
var formInUse = false; function setFocus() { if ((!formInUse) && (typeof(document.ScheduleForm.txtGrossPayroll99) != "undefined") && (typeof(document.ScheduleForm.txtGrossPayroll99) != null) );{ document.ScheduleForm.txtGrossPayroll99.focus(); }}