This is one example .... this is repeated about 20 times in the
program, one for each year of our history...
It works fine ... but not on all the browsers in our office. Most work
fine ... others (all IE) work fine on some dates; other dates, when
you hover, flash a blank page repeatedly until you move the mouse
away; almost as though it is looping ...
I notice that "about:blank" flashes briefly before the called page
comes up ... but that appears to be normal.... I have checked and
rechecked all coding, all brackets and semi-colons ... and it works
perfectly -- for me and for a few others.
I recently updated from jQuery 1.4 (I think 1.4.4) to 1.5.1. Before the upgrade, when users pressed the browser's Back button, they would usually be taken back to a page with all their changes intact. If they had modified input values or clicked objects that caused other parts of the page to change, they would still see those changes. Back literally took them back to the exact thing they were looking at before. Under 1.5.1, Back takes them to the prior page as it was when it first loaded. What changed? Can I get the old behavior back?
I coudn't understand some behavior of RegExp.test function.
Example html code: ---------------- <html><head></head><body><script type="text/javascript"> var r = /^https?:///g; document.write( [ r.test('http://a'), r.test('http://b'), r.test('http://c'), r.test('http://d') ]); </script></body></html> ---------------------
The page displays true, false, true, false. (in Opera, Firefox and IE) This is strange because I expected it would display true, true, true, true. There must be something I didn't know about the function RegExp.test.
I am making a small gallery script. When a user clicks an image, I would like for a function to be called that tells the browser where that image is located in an object. For example:
[Code]...
It works, I just don't like it because it is messy and it seems sensible that some workaround exists.
I've got a div, and it has an onMouseOver handler attached to it which makes a second div visible. The second div shares part of one side with the first, but not all.
The first div also has an onMouseOut handler which, you guessed it, makes the second div invisible.
However, if the user rolls out of the first div and into the second, I'd like to keep the second div visible. Any ideas how to accomplish this?
My question is regarding the behavior of Supersubs in IE6. It seems to adjust to the correct width, but, it applies the new width to all of the parent UL's of the widest LI. In IE7 and FF the new width is only applied to the containing UL of the LI.
Is there a way, besides writing another method, to make Date.setMonth() do something more useful than nothing when the month in question creates an invalid date? If I try
d=new Date(); d.setMonth( 1 );
today, I'd really like to get some kind of an error rather than silent failure.
I have a table that changes its cell (input text) colors when their contents have changed (actually on keypress) and shows a couple of buttons automatically, UDPATE and CANCEL. This works partially, though detecting enter and escape doesn't seem to work, or parhaps calling the button click events directly doesn't (see below).
In addition to getting the ENTER and ESC keypresses to fire their appropriate button clicks, I need to be able to collect information on which cells have changed, so on the page loading again I can read this information, perhaps from a hidden field, to use to update a database server-side.
<script language=javascript> function GirdTextKeyPress(txtID, btnsContainerlID, btnUpdateID, btnCancelID) { var txt = document.getElementById(txtID); txt.className = 'GridChanged' var bc = document.getElementById(btnsContainerlID); bc.style.display = 'inline'
var btnUpdate = document.getElementById(btnsContainerlID); if (event.keyCode == 13) { event.returnValue=false; event.cancelBubble = true; btnUpdate.click(); }
var btnCancel = document.getElementById(btnCancelID) if (event.keyCode == 61) { event.returnValue=false; event.cancelBubble = true; btnCancel.click(); } } </script>
Normally, a button like <input type="image"is also a submit button. Is there any way to override that so that it has an onclick event but does not submit the form?
For what I'm trying to do, I cannot use an <imgelement with onclick. I have to use a form element (and I'd rather have an image than a button)
I've been working with a page that should act as a 'jump page' before loading a PDF and when I use the location.replace function to replace the jump page with the resulting PDF, both the jump page and the pdf show up into the browser history (in IE only) leading to the dreaded back-button loop. Code:
I want to call a JS function when Enter is pressed inside the form, and when the submit button is clicked I want to submit the form. Any simple way for doing this?
i'm sure its been thought of before and i'm sure this is just gunna piss off the people who like to tab through their pages, but i just made a little behavior component file that stops any links from gaining focus on your page.
put this is the style section of your page.
<style type="text/css"> a { behavior: url("hidefocus.htc"); } </style>
then put the attached file in the same dir. (hidefocus.htc) this is all it is
Note: since this behavior is stored in an external file, sometimes one instance of link focus can occur before the htc file can be loaded. if anyone has any tips on fixing that i'd like to hear'em.
I have a drop down menu on my page, works. Then I went to add another ddm, doesn't work when on page, but works independently . DW creates a file called mm_menu.js. I am sure the problem is here, but I don't know what to change. Might anyone here know what I am talking about/had this prob before?
I have a JSP page on which when print is pressed - Records are fetched on a redirected page and those are to be printed.
I use the lines - <script language="javascript"> window.print(); history.back(); </script> to do the same.
When browsed from Netscape 4.7, the Resultset page is printed perfectly whereas in IE6, the resultset page is generated and the source page is printed i.e. the one where Print command was given
Is there a workaround for IE6 for the same which will let me print the Result page silently without changing the sequence of operations for the user?
ok, here's the background on my "lets learn jquery" debacle ... I have downloaded it (plus the UI) and that demo index.html loads and functions perfectly.
well, I can create a brand new .html document, and include just the jquery.js and perform something, and it will work ... here's the thing, if I change *anything* in the source file, the content in firefox will not refresh ... I could even delete random tags, including the <body> tags, the <h1> tags and text ... and it will just not carry over to the browser. And, if I view the source on firefox it will show a random amount of lines removed from the bottom of the .html file
what in the world is happening ... it is driving me crazy that i cant figure this out. (btw i'm using jquery1.4.4 on centos5.4 + apache2.3.3, and firefox3.6.6 from win7 if it matters)
to recap, if i start with a blank/fresh/from scratch file it will work as designed ... but as soon as I change anything, adding or removing code/content, it blows up randomly displaying content (even old content that isnt even saved in the .html file anymore!)
I have a div i would like to present and while it is presented i would like to disable everything else behind (like what modal dialog does). I'de like to write it myself and not use a plugin, is it hard to do?
I want to add an event to a generated SELECT field. It's an onChange call to a function named calculateSubtotal(). The result I want would look like <select name="..." id="..." onChange="calculateSubtotal()">.
This is what I've got so far. The drop menu is created with no error, but no onChange either. Code:
I've recently transitioned from kubuntu to slackware 13.0. I find that although crossover could "run" a fully functional Internet Explorer session on kubuntu, there are all kinds of problems getting IE working correctly on slackware. (with wine or crossover). This begs the question: Is there a firefox plugin that would enable me to test javascript on firefox as if the javascript were on IE? If not, I'll be that I am not the only developer that could use such a feature.
I have been spending my whole life on converting a flash version of a header/menu system to jQuery HTML. It is very nearly done in that it works nearly 100% perfectly in Firefox and IE8. [URL]. Unfortunately, in Chrome and Safari, my menu events of the top menu seem to fire inconsistently, and in the wrong order. It is easy to trigger a problem by simply circling your mouse over the top links. One of the menus will retract when it's already retracted, or the mouseover event for one or more of the links will seemingly detach, making the menu unusable.
The way it is supposed to work is as follows: Person hovers over link, causing menu to slide out and the mouseover event to be detached. This also triggers a 1 second timer that retracts the menuHovering over menu cancels 1 second timer.When the mouse leaves the menu, the menu is retracted and the original mouseover event is attached to the link. It's a bit hackish but it works and I've spent way too much time on this project as is. I have a lot of iphone detection checking to disable/enable some portions of the code if the browser is mobile safari. The site works fine in mobile safari as is.
I'm trying to prevent any mouse clicks on my page (if only for a short time), and I have this working on a very simple test page, but within my application (that has a very large DOM footprint) nothing is working. function noop(){ return false; } jQuery( document ).bind( 'click mousedown mouseup', noop ); I am running this code well after the DOM is loaded. I've tried binding to document, document.body, "*", and window. I am not dealing with any frames. I've also tried unbinding any click/mousedown events prior to binding. I am currently using jQuery 1.2.6, although for fitness I tested this with 1.3.2 but I get the same results. What could I be doing wrong?
I'm using the pause setting to pause the slide show when the mouse hovers over the slides. The problem is if I come from a page where the link is in the same area as the slide show, it reverses the hoverbehavior. That is, it cycles on hover and pauses when the mouse is moved off the slide show.
If the mouse is moved outside of the slide show before the page is loaded, it works correctly.
I'm using javascript in addition to a web service (BTBuckets) to display different content to visitors based on actions they take on my site. The javascript is working fine, but I noticed that if I simulate BTBuckets being disabled using Firefox Adblock none of the content shows up. So in the off chance of the service going offline it'll leave some pretty funky holes in the my content. I tried <noscript> tags which works with javascript off, but the content is still blank when I disable BTBuckets. I'm wondering if there's a way to display the default content if the service is unavailable?
Here's the code I'm using: In the head: <script type="text/javascript"> //<![CDATA[[ $BTB={s:XXXXX}; $BTB.jsh="[URL]"; //]]> </script> <script type="text/javascript"> document.write(unescape("%3Cscript src='" + $BTB.jsh.replace(/(https?:)/i,document.location.protocol) + "' type='text/javascript'%3E%3C/script%3E")); </script>
The code in the body used to replace an image depending on visitor behavior: <script type="text/javascript"> var _t = ""; if ($BTB.clusters["ppc_visitors"]) { _t = ""images/top-photo-tracking-number.jpg" alt="Call Toll-Free: 1-800-XXX-XXXX">"; } else { _t = ""images/top-photo.jpg" alt="Call Toll-Free: 1-800-XXX-XXXX">"; } document.write('<img src= ' + _t ); </script> <noscript><img src="images/top-photo.jpg" alt="Call Toll-Free: 1-800-XXX-XXXX"></noscript>
I want to have a single window with 6 or so links at the top that display fixed pages for the first 4 and the final two "Brow" and "se-H" or "se-S". When you double click "Brow" a script prompt asks to enter where they want to go. The script then adds http:// to the front of it and places it as the src for an iframe in a <div></div> layer that has its visibility as hidden. "se-H"/"se-S" Hide and show the layer wich has a zindex higher than that of all other layers on the screen. The other links that just have the code strung out in the onClick action are working just fine as does the Brow link the only resultant error is the "se-H"/"se-S" links they change back and forth indicating the script is running and the outerHTML code is ok but the zindex just isn't changing nor the visibility. I am asking for any suggestions and if I have not included all necessary code please tell me as I only took the pieces I thought may be causing the trouble:
<SCRIPT> function show() /*show*/{ fun2.style.visibility='visible' /*show*/}
function hide() /*hide*/{ fun2.style.visibility='hidden' /*hide*/}
var go_to="" function disp_pop() /*disp_pop */{ go_to = prompt("Where do you want to go? ","") /*disp_pop */}