bimalpoudel — 2011-01-27T15:02:01-05:00 — #1
I have posted two issues here:
- Does div.innerText work in Firefox? It seems, not.
IE and Opera support this.
- In IE6, the HTTP_REFERER misses the GET parameter.
I expected the page being called inside an embedded flash plaer (in fact, Google mp3 reader) does not have ?code=... in the referrer.
[HTTP_REFERER] => http://localhost/media/player.swf?code=M3BtLmFsay9haWRlbS9zY29kdGgvOkY=
It is seen in Opera and Firefox. While, IE sees:
[HTTP_REFERER] => http://localhost/media/player.swf
I just found these while I was trying to safeguard the mp3 files being played inside the Google reader.
var player = document.getElementById('player');
var mp3_file = player.innerText;
# NOT WORKING IN FIREFOX, but in Opera/IE. I need a text version only
player.innerHTML = ''; # throw anything inside it
var embed = document.createElement('embed');
# in [b]IE6[/b], this code is lost in referrer
player.appendChild(embed); # install the player
felgall — 2011-01-27T15:20:44-05:00 — #2
innerText is an IE proprietary property. Opera copies many of the IE proprietary codes - other browsers do not usually do so. The only IE proprietary property similar to innerText that was considered useful enough for all browsers to adopt it as a defacto standard is innerHTML. Simply substitute innerHTML for innerText and it should then work for all browsers.
embed is also a proprietary tag (admittedly one supported by most browsers). You would probably get it to work better if you instead used the standard object tag that is intended for the purpose. See http://www.felgall.com/flash.htm for two ways to use object tags to embed flash depending on whether or not you need to support antiquated flash versions in IE6.
bimalpoudel — 2011-01-27T15:32:23-05:00 — #3
Thanks. I will rewrite the codes for FF and Opera.
I don't really care if IE cannot render my pages correctly.
If I modify the original HTML, I can read the values inside the div correctly.
<!-- flash player goes here -->
<!-- flash player ends here -->
The real code here is inside the span tag. I will write as:
<span id='..'>...code...</span> inside the #player div.
This will solve. Thanks Stephen.
mrhoo — 2011-01-27T16:12:49-05:00 — #4
element.textContent is the non-ie element.innerText
var text=element.textContent || element.innerText || '';