Building owner exceyond (Nanke) 18:05:43 question in Web development/JavaScript
Example:
<Script language = JavaScript>
VaR pakstring = "lalalala"
Document. All. Pak. innerhtml = pakstring;
</SCRIPT>
<HR> call <HR> fail <HR> <SpanId = Pak> </Span>
The error message is "document. All. Pak is empty or not an object"
Please correct me. Remember to write this before. In addition, the newly installed IE6 issue points: 30. Reply times: 5top
Kisslan on the first floor)Back to 18:28:26 score
10
SetJSPut inSpanLater, you put it in front, it has not been resolvedSpanSo the top
Exceyond (Nanke) on the second floor)Back to 18:38:20 score 0
My intention is to write a piece of HTML inJSAs an independent file.
<SCRIPT src = mycode.JS> </SCRIPT> in <SpanId = Pak> </Span> Is there a way to implement the preceding situation?
In the impression, HTML is a tough fight,JSMost
Thank you for your advice. Top
Afoskoo on the third floor (print suspended)Back to 18:41:05 score
10
Write as a function, and then call. top at the end
4 floor lidelu (animator)Back to 18:43:54 score
10
JSIf it is called as a function, it can be placed in a location on any page
However, if you want to directly load the page, you have special requirements.
When you execute document. All. Pak. innerhtml = pakstring; on your page,
<SpanId = Pak> </Span> The object cannot be found because it has not been loaded.
If you wantJSAs an independent file,
<SpanId = Pak> </Span> Later, such as the end of HTML. Top
Exceyond (Nanke), 5th Floor)Back to 18:53:25 score 0
Either adding the code in HTML or modifying the Code Location in HTML, I don't have that big permission to require the customer to change so much
The possible method is,
1. Determine that other HTML files have been downloaded and then execute the externalJS;
Second, the time delay is simply used when it cannot be accurately determined, and will be executed in a few seconds.
Check whether the HTML page has been downloaded (excluding externalJS?