XRegExp is an open source JavaScript library that provides an augmented, extensible, cross-browser implementation of regular expressions, including support for additional syntax, flags, and methods.
It’s used by the popular SyntaxHighlighter script, which is in turn used by many websites (including this blog) to display syntax-highlighted source code on the client. Thus, XRegExp has a rather wide usage base.
However, XRegExp conflicts with jQuery. In IE, any page that includes XRegExp and runs a numeric jQuery animation will result in “TypeError: Object doesn't support this property or method”.
Demo (only fails in IE)
This bug is caused by an XRegExp fix for an IE bug in which the exec
method doesn't consistently return undefined
for nonparticipating capturing groups. The fix, on line 271, assumes that the parameter passed to exec
is a string. This behavior violates the ECMAScript standard (section 15.10.6.2), which states that the parameter to exec
should be converted to a string before proceeding.
jQuery relies on this behavior in its animate
method, which parses a number using a regex to get the decimal portion. (source)
Thus, calling animate
with a number after loading XRegExp will fail in IE when XRegExp tries to call slice
on a number.
Fortunately, it is very simple to fix XRegExp to convert its argument to a string first:
if (XRegExp) { var xExec = RegExp.prototype.exec; RegExp.prototype.exec = function(str) { if (!str.slice) str = String(str); return xExec.call(this, str); }; }Here is an updated demo that uses this fix and works even in IE.
28 comments:
Thanks this really saved me ...
Is this fixed at http://xregexp.com/ now?
@LeoB: Given that the last released version was in 2010, one and a half years before I wrote this, I rather doubt it.
http://xregexp.com/history/
You may be right.
I just sent a mail to Steve.
Exactly the fix I needed. Thanks!
This has finally (!) been fixed in XRegExp 1.5.1. Thanks to both of you for reporting it.
I've been also been wondering how to figure this out.
May be tough for non-coders who are looking to implement this on their site.
These tips are very helpful.
Penelope
The above article is nice and interesting, thank you willing to share! Greetings success of admin Percetakan Murah Rawamangun Jakarta Timur wish you deign to visit my website, thank you :)
This is one of the most informative post about Dissertation Help Service. I bookmarked this post and share with friends as well.
This is very nice blog i like this blog very much. here more than one important beautiful works will be displayed with quality essays
.
I love reading very much. Your article seemed instructive to me. Since I'm learning I'm interested in everything! And recently I was faced with the task of writing an ib extended essay. I sat long enough to realize that the task was too difficult for me. So I turned to the writing service, and I did great! Since I think the help is not plaintive, but instructive!
هوروش بند
پازل بند
This is a very nice one and gives in-depth information. I am really happy with the quality and presentation of the article.
Full stack Training in Indore
I hope there would be an extension that would work like as XRegExp breaks jQuery animations. Can I know the name of such extension if it exists? Dissertation Proposal Writing Service
Deadlines are pretty hard on students. If a newbie enters a programming class, he needs to pick up the pace on time and finish off all the Java assignments on time as other students in the class. But it is not always possible for each and every student to finish the task on time. They need to handle other subjects too. But deadlines never wait for anyone, and if not submitted within the stipulated time, the assignments will get rejected by the professor. So, the student needs to clear the assignments on time. Hence, they look for Java programming assignment help at the hour of need.
Make sure the surface where you are placing the printer is clean and close to Pc or laptop.Check the shipped components with your inkjet printer
http //ij.start.canon,
https //ij.start.cannon
Canon IJ Network Tool will get you through the network settings uninterruptedly. It is essentially required when you are attempting to get your printer connected to a different network because a new network tends to reset the printer’s existing network settings.The Canon IJ Printer Utility can be used to keep a check on your printer’s ink levels and cartridges and clean the ink tanks and paper feed rollers. Also, you can make adjustments to your Canon printer’s power settings.
Once you are done with the driver setup via canon.com/ijsetup , you will have to insert a pile of pages into the printer tray for printing the documents..
Visit ij.start.canon | ij.start canon and find out the best way to download Canon printer drivers.
All-in-one Canon Inkjet printers are suitable for home, business, school, and others to improve productivity. You can easily set up your Canon printer through drivers from Canon.com/ijsetup , wireless connection, USB, and a few components.
The ij.start.cannon setup process for every Canon model is almost similar, however the download through https //ij.start.cannon and http //ij.start.cannon installation process may differ. you can also visit canonsetup-canon.com/ijsetup website for same. Https //ij.start.cannon.Depending on your requirement, it offers a type printer including PIXMA, SELPHY, MAXIFY, etc. canon.com/ijsetup
Thank you for the motivational article. It sparked my imagination. Very beneficial to me!
coloring pages
Amazing website, Love it. Great work done. Nice website. Love it. This is really nice.
Hbomax/tvsignin
Disneyplus.com/Begin
Disneyplus com login begin
Cricut.com/setup
POSITIVE SITE COME UP WITH THE INFORMATION ON THIS POSTING? I'M PLEASED I DISCOVERED IT THOUGH, ILL BE CHECKING BACK SOON TO FIND OUT WHAT ADDITIONAL POSTS YOU INCLUDE. THA NKS TO THIS!
고스톱
YOUR WEBSITE IS VERY VALUABLE. THANKS FOR SHARING.
스포츠토토
HI! THANKS FOR CREATING THIS BEAUTIFUL POST, IT'S REALLY NICE.
일본야동
nice article thanks for sharing. Ethical Hacking course in Pune
nice post.
CCNA course in Pune
Post a Comment