Different literal JavaScript object behavior in FireFox and Google Chrome?

I narrowed my error to the following set of codes creating different behavior in Google Chrome:

Sample code: http://jnvxxx.appspot.com/rpc/static_server?key_=testjs.html

Firefox Exit: Hi 1 [Object Object] 192 Hi 2

Chrome output: Hi 1 [Object] undefined Hi 2

Any idea is hot for getting attributes working in Google Chrome.

Thank.

+3
source share
1 answer

You get access to the property window.statusthat is used to control the text in the status bar. See: http://www.w3schools.com/jsref/prop_win_status.asp .

-, , , -, , . Chrome status string, cryptic-but-familiar "[object Object]", entry_count. Firefox status.

: window.status - ; .

EDIT:

, - , :

(function() {
   var myStatus = {...};
   // Do something with myStatus, preferably not document.write ;)
}());

var a = typeof myStatus; // a === 'undefined'.

, .

+5

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


All Articles