1 | <html> |
---|
2 | <head> |
---|
3 | <title>Custom Tag Replacement</title> |
---|
4 | <script src="http://www.hacres.com/js/jquery-1.4.2.min.js" type="text/javascript"></script> |
---|
5 | </head> |
---|
6 | <body> |
---|
7 | <p>The below appears fine both in Firefox and Chrome, but not IE7 nor IE8.</p> |
---|
8 | <p> |
---|
9 | <jtag type="events" key="133"></jtag> |
---|
10 | </p> |
---|
11 | <script language="javascript"> |
---|
12 | $(document).ready( function() { |
---|
13 | $("jTag").each( function(){ |
---|
14 | var jTag = $(this); |
---|
15 | jTag.html('<a href="http://www.hacres.com/education/event-calendar"><img src="http://www.hacres.com/images/loading.gif" alt="Click here if this continues to load..." /></a>'); |
---|
16 | var jTagUrl = "http://www.hacres.com/inc/jQueryTags.php?"; |
---|
17 | var attrs = ['type', 'src', 'key', 'rand', 'desc', 'limit', 'more']; |
---|
18 | $.each(attrs, function(i,a) { if(jTag.attr(a)) jTagUrl += '&'+a+'='+jTag.attr(a); }); |
---|
19 | jTag.load( jTagUrl, function() { jTag.replaceWith( jTag.html() ); } ); |
---|
20 | }); |
---|
21 | }); |
---|
22 | </script> |
---|
23 | </body> |
---|
24 | </html> |
---|