Quantcast
Channel: Tyler Frankenstein - internet explorer
Viewing all articles
Browse latest Browse all 2

JavaScript Regular Expressions in Internet Explorer

$
0
0

So today Internet Explorer again decided to be totally awesome...

I have a simple javascript regular expression that extracts the Drupal 'page' variable from a link that was clicked:

<a href="/code?page=1" id="tf_example_link">next page</a>
$('a#tf_example_link').click(function () {
  var page = /[\?&]+page=([0-9]+)[\?&]?/($(this).attr('href'));
  alert(page); // alert output: 1
});

This works in all browsers, except....... drum roll.............. Internet Explorer! Surprised? Probably not.


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images