简体   繁体   English

在启动Firebug控制台之前自动执行javascript行

[英]Automatically execute a javascript line before starting the Firebug console

Usually, in the linux/unix terminal is possible to initialize the console with a predeterminated line of code. 通常,在linux / unix终端中可以使用预定的代码行初始化控制台。 I'm using the javascript console with Firebug, and I asked if it is possible with the Firebug's javascript console (Some script maybe...). 我正在将JavaScript控制台与Firebug一起使用,并询问Firebug的javascript控制台是否可行(也许有些脚本...)。

Edit 1: 编辑1:

An example: 一个例子:

Initially, when I start Firebug's javascript console, the Jquery library cannot be used with $ , because Jquery is a namespace in my project, so I have to program a line of code for using the terminal the simbol $ as Jquery (something like $=PROJECT.NAME.$ ); 最初,当我启动Firebug的javascript控制台时,Jquery库不能与$一起使用,因为Jquery是我项目中的名称空间,因此我必须编写一行代码,以将终端simbol $用作Jquery(类似于$=PROJECT.NAME.$ );

I want to obviate this line of code for each time I refresh Firefox. 我想在每次刷新Firefox时都避免使用这一行代码。

If you don't want to reassign $ in the code, I'd suggest creating a bookmarklet to execute the re-assignment. 如果您不想在代码中重新分配$,建议您创建一个书签以执行重新分配。 You'll have to click the bookmarklet every time you open Firebug. 每次打开Firebug时都必须单击小书签。

Name: $ reassign 名称:$ reassign

URL: javascript:$=PROJECT.NAME.$ 网址:javascript:$ = PROJECT.NAME。$

(A bookmarklet is created the same way you would create a bookmark, but instead of opening a webpage, it executes the javascript in the URL.) (创建书签的方式与创建书签的方式相同,但是它不会打开网页,而是执行URL中的javascript。)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM