jquery - Disabling javascript in a child window, from the parent -


bit of weird request, i'd able have parent window:

  • create new child window on same domain (using window.open)
  • prevent javascript running in child window

currently, can within in child window including following @ top of page:

<script>   function.prototype.call = function() {};   function.prototype.apply = function() {}; </script> 

this pretty stops javascript in child page running. there way me from parent window? can somehow inject code child page before scripts have chance run?

or there other way this?

any appreciated

you can use bit of server side remove <script> tags , inline event handlers onclick.

edit

using client side can try grab whole page using ajax remove scripts there , write content newly created window. don't think able use

$.get('page.html', function(html) {     var html = $(html).find('script').remove().html(); }); 

because scripts may executed when added dom, maybe need use parser or regex.


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -