JavaScript: Ci not defined

I just spent half of mine to find out what caused the "Ci Undefined" error message in my JavaScript code. I finally found a reason:

It should be (jQuery):

$("asd").bla();

It was:

("asd").bla();

(Dollar sign is missing)

Now, having fixed the problem, I would like to understand the message itself: what does Firefox mean when it tells me that "Ci" is not defined. What is a "Ci"?


Update: I am using the current version of Firefox (3.0.3).

To reproduce, just use this HTML code:

<html><head><title>test</title>
<script>
("asd").bla();
</script>
</head><body></body></html>

To be clear: I know what caused the error message. I just wanted to know what Firefox is trying to tell me with "Ci" ...

+3
source share
3 answers

, FF , , , , , bla() , String. $, , , ("asd") , JavaScript bla() . , :

String.prototype.bla = function() {};

// now this next line will execute without any problems:
("asd").bla();

, , Ci - Firefox, . , , -, - Firefox, ...


UPDATE: FF, , :

: "asd".bla
: :///C:/test.html
: 3

, /, - ? , - Greasemonkey script -?

+3

, , . (, Firebug, Geode) Ci :

const Ci = Components.interfaces; 

, , .

+2

Assuming this is CodeIngiter, it cannot find the js file.

-3
source

Source: https://habr.com/ru/post/1699230/


All Articles