最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

javascript - What means moz-nullprincipal? - Stack Overflow

matteradmin8PV0评论

Here is a small Javascript. (It is a ‘smallest example’.)

<script>
    var now = new Date();
    var minute = now.getMinutes();
    if (minute < 10) minute = "0" + minute;
    document.write(now.getHours() + ":" + minute);
</script>

This throws the following error in Firefox (16.0.2):

nicht wohlgeformt
moz-nullprincipal:{356ab095-a1ae-4ba6-a22c-1df0f260f702}
 if (minute < 10) minute = "0" + minute;
------------- ⬏

(“nicht wohlgeformt”: German, meaning ‘not wellformed’.)

What is the meaning of “moz-nullprincipal”. I didn’t find anything informative about that error. What’s wrong with that line?

Here is a small Javascript. (It is a ‘smallest example’.)

<script>
    var now = new Date();
    var minute = now.getMinutes();
    if (minute < 10) minute = "0" + minute;
    document.write(now.getHours() + ":" + minute);
</script>

This throws the following error in Firefox (16.0.2):

nicht wohlgeformt
moz-nullprincipal:{356ab095-a1ae-4ba6-a22c-1df0f260f702}
 if (minute < 10) minute = "0" + minute;
------------- ⬏

(“nicht wohlgeformt”: German, meaning ‘not wellformed’.)

What is the meaning of “moz-nullprincipal”. I didn’t find anything informative about that error. What’s wrong with that line?

Share Improve this question edited Sep 12, 2015 at 1:51 Mogsdad 45.8k21 gold badges163 silver badges286 bronze badges asked Nov 21, 2012 at 7:49 Matthias RongeMatthias Ronge 10.2k7 gold badges48 silver badges68 bronze badges 1
  • I can not reproduce this on Firefox 15.0.1 or 16.0 under Mac OS 10.8.2. This might be a bug with your current config, or maybe a plugin. – Jørgen R Commented Nov 21, 2012 at 8:09
Add a ment  | 

2 Answers 2

Reset to default 2

I googled the keyword "moz-nullprincipal", then the error occurs by Google Toolbar.

(Japanese) http://st777.seesaa/article/139189718.html

The page said you should re-install new version of Google Toolbar.

The code is valid, this should work. moz-nullprincipal is an error trigger by firefox in some json / ajax cross scripting security. See here : Cross-domain Ajax call gets no element found Location: moz-nullprincipal

Are you sure that the error "not wellformed" and "moz-nullprincipal:{356ab095-a1ae-4ba6-a22c-1df0f260f702}" are related ?

Can you try this way ?

now = new Date();
var minute = now.getMinutes();
if (minute < 10) minute = "0" + minute.toString();
document.write(now.getHours() + ":" + minute);

Which version of firefox are you using ? Are you using JQuery ?

Post a comment

comment list (0)

  1. No comments so far