Hi everyone
I'm trying to combine two codes.
1.) Code for append parameter to every href:
- $(function() {
- $("a").attr('href', function(i, h) {
- return h + (h.indexOf('?') != -1 ? "&ajax=1" : "?ajax=1");
- });
- });
Source (http://stackoverflow.com/questions/2667551/add-parameter-to-links-on-page-using-jquery)
2) Code to make selection within a iframe
- $("iframe").contents().find("textarea").keydown(...)
Source (http://stackoverflow.com/questions/2893280/jquery-select-iframe-children)
So this is my code:
- <html>
- <head>
- <script type="text/javascript" src="jquery-1.9.1.min.js"></script>
- <script type="text/javascript">
- $(document).ready(function () {
- $("#content_ifr").contents().find("a").attr('href', function(i, h) {
- return h + (h.indexOf('?') != -1 ? "¶1=value1" : "?para1=value1");
- });
- });
- </script>
- </head>
- <body>
- <iframe id="content_ifr" src="http://www.test.com" width="100%" height="100%" name="SELFHTML_in_a_box">
- <p>No iframe supported!
- </iframe>
- </body>
- </html>
However, this doesn't work. Can someone help me please?
Kind regards
querynewbie (damn, I forgot the 'j' at signin ;)