How to run jQuery directly on any page in the browser?

后端 未结 8 692
你的背包
你的背包 2021-01-31 21:17

Is there some programmatic way (or maybe a browser plugin) that allows users to arbitrarily run any jQuery they want on a webpage that is currently loaded in their browser?

8条回答
  •  北荒
    北荒 (楼主)
    2021-01-31 22:11

    eval executes any string you pass it, but if its usage is 'proper' is contested.

    eval('$(function() { alert("hello"); }');
    

    will show an alert on document ready (provided that jQuery is sourced before the eval is called).

提交回复
热议问题