I was wondering how I could detect if a user has ad-block or ad-sweep or any other ad blocking ad-ons for that matter. I want to be able to detect this because if they do have ad-block I want to display an image in the place where the blocked ads are. That way theres not all this empty space
Can Javascript be used to detect a certain url and then "not" write some html according to that url and also detect something on the page and "then" display some html?.
Example: I'm working on a volusion site that uses asp. There's basically only one page that's changed dynamically. I would like to display some html when and only if the cart has any items in it. But also not to show up on the check-out pages.
The page dynamically displays "Your cart has 1 item in it..." when the visitors puts something in their cart.
So could javascript detect when this is displayed then write some html and then also detect if the url is showing the cart and then not show the html?
I was making a website, all looked great, untill I started IE7. there, it really looked like crap.Now I'd like to just make another css file for IE6 and/or IE7 but not for IE 8, because it does look wel at that browser.
Is there a way to detect which textarea the cursor is positioned in? I would not want to attach 'onkeypress' to all textareas to detect which one I am presently in ... or is this the only option?
how I might use JavaScript to detect the overflow of text in a DIV. Currently, I have the CSS set to Code:
overflow:auto
However, having scroll bars are pretty tacky. Instead, I'd like to be able to detect the overflow, which would then add a small <a href> link that says "More."
i was developing a blog and I came across may site have recaptures to prevent spams.but my opinion is using recaptures will avoid the number of users put comments in the site as an example you can consider myself that doesn't like that feature.problem is how to detect the spams ? Is there any mechanism to detect, if so I want to set it to my site.
Is there any way I can detect if there is a scroll bar on the right of my web page.
I use a javascript drop down menu and position it precisely with certain pixel count. It's a photo gallery.
However, if the picture has an extra size, the menu looks ugly with a scroll bar on the right. I've tried every method found on Google search but it's not working.
Pardon a silly question, but what's the best way to determine if a variable is an array in JavaScript? I need to treat it differently depending of if it's a string or an array.
if (navigator.appName == "Microsoft Internet Explorer"){ if (version.substring(0,1) <= 4){ if (version.substring(22,23) <= 4){ document.write("This Browser is IE4 or lower!"); } else{ document.write("This Browser is IE5 or higher!"); } } } else{ document.write("This Browser isn't IE!"); }
document.write("<br>This Browser is " +version); </script>
The version string usually return's something like this:
4.0 (compatible; MSIE 5.0; Windows 98; DigExt)
Can anyone see any problem with using this method?
Working on the basis that MOST Internet users to visit the site I have built, have IE6 or later, I would like to add a browser-detect capability that ONLY focuses on IE6 and sends the user straight away to the alternative page. If using a browser older than IE6 neither the real page, nor the alternative, will work anyway, so it doesn't matter which one fails for them. I've lost my Javascript book (shoot me in the head!) and trying to find browser detect code online, I keep finding massive reams of code where the intention is to detect exactly which browser is being used. I'm not bothered, unless its IE6.
The site works fine in Opera, Firefox and IE8, I had to tweak it slightly to work fine in IE7, but for IE6 it would completely ruin the feel of the site for everyone else if I were to tweak the main site. So, please if someone could paste the code that would say "If user's browser is IE6, then auto-redirect to this page",
How can I do something like "browserTab.onfocus = myFunction" by which I mean that "myFunction" would get control any time something in it's browser tab gains focus? E.g., when the user switches from a different browser tab or a non-browser window. I don't need to know what got focus, just that something did in that tab. "window.onfocus = myFunction" with event capturing works fine except when the main window contains frames. Doing document.getElementById('iframeId').contentWindow.addEventListener('focus',myFunction,true) to add an onfocus handler to the iframe's document works in Firefox except when the frame's content comes from another site, which is my case and I cannot modify that site. I'd rather not poll using document.hasFocus().
I am currently trying to write some javascript that detects mouse movement in some way or another. This is for a website vistitor tracking script i am writing. The purpose would be to detect if the vistor is human or robot. Right now myfunction() grabs the info and inserts it into our database if any mouse movement is detected. But the script executes every time the mouse moves on the same page. So we are getting multiple log entries when we only want one.
So my question is this: Is there a way to once javascript has detected mousemovemnt once, to not detect it again? here is my code document.onmousemove = function() { myfunction();} I am not all too familliar with javascript and will probably need written out examples to grasp this.
I would like to generate a page of links including some of the pdf properties (title, author, version, etc.) for a folder full of pdf's. Is this possible from Javascript?
Is there anyway to detect if scrollbars were made visible in a textarea? I'm not talking about initial setting of the scrolling attribute, but rather whether scrollbars have been added either horizontally or vertically based on the users text input?
I have a webpage in which a media player is embedded.I would like to close the page at the end of the video. Can I detect the end of the file so as to close the page programmatically?
I have a text box where the user enters their employee email address. What I want to occur is when the @ sign is pressed it will automatically add the rest (ie. mycompany.com)
I know the code required to alter the value of a text box but I dont know the event trigger or code to detect the keypress.
I have a web application that has basic authentication turned on (IIS). What I would like to accomplish is detect whether user is navigating away from the site or simply going to the different page using JavaScript. I am aware that it is easy to detect where you came from (referrer), but I haven't been able to find a way to where you're going to. I did my fair amount of research online, but I couldn't find a solution for this.
However, my boss told me that he has seen a website that detects the fact that you're navigating away from your site. Does anyone know anything about this?
I am wondering if any of you Javascript experts can enlighten me on which event to call. The use situation is that the tetxbox field is populated from the DB and the add/update and delete will work only when a textbox for reason for change is entered. This mean if a user simply type in the same value as before, the ASP.NET textbox will be marked with changed. But it should not limit that a user can not change the whole value in the textbox at all.
I have looked at keyup, mousedown, etc. but it will calling the function after every key is entered and that is what I don't want to happen.