Problem I began with: Netscape/Opera supports hover for different elements, IE only supports hover for <a> and I want to use hover for <td class="menu">
I then found a fix using some Javascript here: http://webpages.charter.net/mmmbeer...rbitrary-hover/
It works ok for IE now.
Problem I now have: I don't want the script to run in a browser that does support hover for <td>.
In other words I noticed that the script was still running for Netscape and Opera - but I would prefer to let those browser's native hover support to work since I notice that in some cases the script can introduce lag at loading time.
I don't want to sniff for IE: I know how unreliable browser sniffing is. I would rather sniff for the lack of hover support.
I'm trying to do the right thing. I currently have a page that doesn't have any JavaScript and the page works. The page works with CSS on or off. Now I would like to add some JavaScript to enhance the page. The JavaScript will rearrange some of the DOM and use CSS.
I am willing to put in the effort to try to ensure that the JavaScript doesn't do anything if necessary JavaScript support for full functionality is not available. This seems like a difficult task. I will do the DOM rearranging onload but before doing this rearranging I will have to check that even the code in the event handlers will work. Like I will have to do something like this
if ( /* check every function I need is available */ ) { // All my JavaScript here }
Is the best way to do this?
It would be an equal failure if the JavaScript does anything if the CSS is disabled. Can I check that the CSS is on?
From what I've read, the JavaScript/DOM support is pretty good for handhelds, but trying a simple page which works on the desktop doesn't work on pocket IE on the device. I know scripting isn't completely disabled, because I can use a script block to write a string, but I haven't been able to call a function to change the string either from a form button click or by adding another script block that calls the function. Both of those work on the desktop. In fact, using a script block to call the function doesn't even work on my device when the string value is written statically in the HTML (so it doesn't have anything to do with using the document.write). Code:
how do i know if a browser supports javascript or not ? I implemented some javascript on my site, but noticed that some browsers do not support our scripts. i am using IE 5.0 now on another system, and it doesnt seem to work.
I'm making an Intranet site for someone who is not very familiar wit making websites, thus I would like to make it as simple as possible fo her when she needs to update it.
The intranet site uses frames - one menu frame that is always present and one frame into which the content is loaded. The intranet sit features many, many links to both internal and external pages - i internal pages within the intranet and external pages on the interne (http://)
What I would like to do is make it so that if a link is internal, th content will load into the content frame and the menu frame will remai at the side, but if the link is external, it will load the target int the entire browser window. Using HTML, this would simply be a matter o stating the href and then target="content_frame" for internal pages o target="_top" for external pages.
But, like I said, I am making this site for someone who is not familia with linking targets and even if I told her to define the targe whenever she makes a link, she'd probably forget or get confused an then wonder why external pages are loading with the intranet menu fram still present or why intranet pages are loading with no menu at th side!
While I have good experience with HTML, I am fairly new to JavaScript which is why I am here asking for help.
I understand that Javascript can detect the protocol of a link, believe you would use "link.protocol". In basic terms, what I woul like to do is:
if link.protocol = "http://" then target="_top" els target="content_frame"
But since I'm not familiar with the precise way of coding JavaScript, would just like some help with transforming this into correc JavaScript code so that it will work.
here is some code that I am working on to load styles into a page depending on the protocol of the URL. It seems to load the .css files correctly in FF but in IE I get an "document.head is null or not an object" error.
Here is the code:
window.onload = function(){ var protocol = document.location.protocol; var ref = document.createElement('link');
I am making a site and I have an SSL certificate installed in the hosting. The problem I have is that any body can enter in the site's directories/files with https and also with http protocol :eek: .
I do not know how to do, so when some body try to open the directories/files with http the site is opened only with https protocol. With .htaccess, javasript, php, ??????
I need to program a language protocol compatibility patch for multiple OS'. I don't know where to start, I'm new to programming BUT at least I know what is needed. If anyone is willing to help, I'm willing to elaborate.:thumbsup:
When I put the in, I get the error message "object doesn't support this action". I've also tried putting in after the </body> tag as another script...no go.
I'm setting the cookie with these lines in another function: varScroll = document.body.scrollTop;document.cookie("Position") = varScroll;
Any clues/suggestions greatly appreciated. I recently posted a similar question, but rearranged how I was doing it, still no luck, so I'm trying again.
I'm having some problem with checking with the follwoing code:
if (appForm.q15a[i].checked==true && appForm.q15cert.value==""){ alert ("You must enter value!!!!") valid = false; }
What I'm trying to do is have the user enter some data based upon if the radio button is true and the text field is empty. What could be wrong with the following code above.
does anyone have a handy check all script? I have a series of check boxes in a form and would like to add the option of clicking a button to select all.
Does anyone know of a way I can check asp validator controls from the client side? I need to be able to opt out of a postback if any validators are false. I am using a ComponentArt tabstrip and it proceeds with posting back even if "IsValid" is false.
I have to access a website which does a stupid browser check and only accepts Netscape 4.7. The problem is that I have to access the website with Mozilla or Internet Explorer. Code:
I want to create a button(s) to check all/uncheck all the check_boxes if clicked by the user. I was thinking I had to use javascript to do this, but the erb is appending the value to the name in the HTML output. What this does is prevent my javascript from recognizing these check_boxes as a collection named "patient".
I know this isn't a pure javascript question, but I am at a loss. I am new to both languages, which doesn't help either.
I currently run a website similar to digg, where users can vote on a story. What I have been using so far to create the vote buttons, are just simply links that insert a vote into a database. And if a user tries to vote again on the same story, it attempts to insert the vote into the database, (im using MySQL btw), but when it cannot, they are redirected to a page where it tells them they have already voted on the story.
Now I thinking there has to be a better way to do this, and that's when digg came to mind. Can someone please point me in the direction of a javascript tutorial/wiki etc. on creating javascript buttons that interact with a mysql database AND remember that you have voted.
Is there a way by which I can validate in javascript whether the file I'm trying to upload is an existant one(i.e., one which is present in my local folder).
I'm having an array dynamically fetched from the database using php, in result, I'm getting a check box, with their corresponding value.
I wanted to make a javascript function so that if I uncheck a checkbox, corresponding value disappears.
Before going to the looping, I was trying to do a simple check - like this -
function checkOtherValues() { if (document.myform.checkmember[0].checked==false) { document.myform.checkvalue[0].value=""; } } I thought this should work, but I'm getting the following error -
document.myform.checkmember.0 is null or not an object For the form, it's set in this way -
Here is the HTML: [URL] I'm trying to uncheck the selected radio button, then set the value to 1 (Yes), basically overwriting theinitialvalue to 1. I've looked at prop(), val(), and attr(), and just don't know where to start. Should I select $('#set_q157 input') or$('#set_q157 input:radio'), or each individual radio?
Do I need to each them, and check if its checked, then change its value, or is there a way to select all three inputs as just one radial button? It would also need to work if the input has not yet been checked.
i have a list of checkboxes, the number of checkboxes is dynamic. All the checkboxes have same name. i am trying to get the length of selected checkboxes.
when i try to get the length in javascript like document.form.name1.length, it works fine if number of checkboxes selected are more than 1, but not for 1.