SoWhat Posted December 8, 2011 Report Share Posted December 8, 2011 (edited) Sveiki! Nepieciešams aizvietot textu lapā. Mēģināju ar sekojošu skriptu, bet tas diemžēl sačakarēja DOM: <script type="text/javascript" > function myscript() { input = 'aaa.lv/bbb/cc/"'; output='ddd.ee.pl/fff/publisher.html?lang=en_GB" onClick="popup = window.open("http://ddd.ee.pl/fff/publisher.html?lang=en_GB", "Registration", "height=450,width=640,scrollbars=yes,resizable=yes"); return false" target="_blank"'; document.body.innerHTML = document.body.innerHTML.replace(input,output); } </script > Edited December 8, 2011 by SoWhat Quote Link to comment Share on other sites More sharing options...
0 briedis Posted December 8, 2011 Report Share Posted December 8, 2011 Neredzu pēdiņas pie output. Atver tak js konsoli, papēti kļūdas... Quote Link to comment Share on other sites More sharing options...
0 codez Posted December 8, 2011 Report Share Posted December 8, 2011 Labāk pasaki, ko gribi. Ja gribi, lai uz linkiem atveras popups, tad vienkārši ar jquery piešķir onclick eventu un atgriez return false, lai neizsauc neizpilda defaulto. http://jsfiddle.net/SuHrB/ $(function(){ $('a').click(function(){ var href=$(this).attr('href'); popup = window.open(href, "Registration", "height=450,width=640,scrollbars=yes,resizable=yes"); return false }); }); Quote Link to comment Share on other sites More sharing options...
0 briedis Posted December 8, 2011 Report Share Posted December 8, 2011 codez, omg omg omg, kur $.delegate??? :D Quote Link to comment Share on other sites More sharing options...
0 SoWhat Posted December 8, 2011 Author Report Share Posted December 8, 2011 (edited) Neredzu pēdiņas pie output. Atver tak js konsoli, papēti kļūdas... Sorry, pēdiņa pazuda pēc iepeistošanas. Labāk pasaki, ko gribi. Ja gribi, lai uz linkiem atveras popups, tad vienkārši ar jquery piešķir onclick eventu un atgriez return false, lai neizsauc neizpilda defaulto. http://jsfiddle.net/SuHrB/ diemžēl ir viens konkrēts links bez klases un bez ID, vienīgā atšķirība ir pats parametrs href. Tevis dotais kods darbosies uz pilnīgi visiem linkiem lapā. Bet galvenais mērķis tiešām ir atvērt linku popupā. Edited December 8, 2011 by SoWhat Quote Link to comment Share on other sites More sharing options...
0 daGrevis Posted December 8, 2011 Report Share Posted December 8, 2011 $('a'[href=http://dagrevis.lv/]'); Quote Link to comment Share on other sites More sharing options...
0 codez Posted December 8, 2011 Report Share Posted December 8, 2011 codez, omg omg omg, kur $.delegate??? :D O, tiešām nofeiloju, laikam vecums. Quote Link to comment Share on other sites More sharing options...
0 SoWhat Posted December 8, 2011 Author Report Share Posted December 8, 2011 Paldies, viss sanāca! Quote Link to comment Share on other sites More sharing options...
Question
SoWhat
Sveiki!
Nepieciešams aizvietot textu lapā. Mēģināju ar sekojošu skriptu, bet tas diemžēl sačakarēja DOM:
Edited by SoWhatLink to comment
Share on other sites
7 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.