Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem in IE8 on local files (without server) #11

Closed
Geist-zz opened this issue Apr 24, 2011 · 5 comments
Closed

Problem in IE8 on local files (without server) #11

Geist-zz opened this issue Apr 24, 2011 · 5 comments

Comments

@Geist-zz
Copy link

Local html file (runs without server, by drag & drop to browser; not tested with server)
script.min included in head (compressed with bananascript; also tested with script.js)

<script type="text/javascript" src="script.min.ban.js" charset="iso-8859-1"></script>

Test script in body (if with filename results are the same), tested in IE8, Chromium 12.0.730.0 (80877), Firefox 4

  • - alert shows
  • - alert doesn't show

Results:
IE8-
Chr+
FF4+

If I add $script(""); before test cases, it works in all browsers.

Test cases (used separately, not all at once):

(function() {

//1.
$script("", function() {
$script("", function() {
alert("test");
});
});

//2.
$script("test", "test");
$script.ready("test", function() {
alert("test");
});

//3.
$script("", function() {
alert("test");
});

})();

Update (not related to issue):
Possible feature to add (if it is possible in JavaScript): don't execute if error occured during loading script file (missing file for example).

@ded
Copy link
Owner

ded commented Apr 24, 2011

gotcha. will investigate.

@ded
Copy link
Owner

ded commented May 10, 2011

this should be fixed now.

@ded ded closed this as completed May 10, 2011
@Geist-zz
Copy link
Author

Yes, it's working now, thank you.

There is, however, still one inconsistency - when script file doesn't exists (and is not empty ""):

$script("test", function() {
alert("Shows only in IE8");
});

/*$script("test");
$script("test", function() {
alert("Shows everywhere");
});*/

@ded
Copy link
Owner

ded commented May 12, 2011

this was fixed :) aa7d59e

@Geist-zz
Copy link
Author

Recently tested (results below).
Quick summary:
Chrome has problem with empty script name (""),
FF4 with non-existing file,
IE8 is the best :)

Some thoughts:
Treat empty script name ("") as invalid (ex. replace "" with null/undefined), it's one special case less.
$script(""); in FF4 seems to load entire html document in head (or it's firebug problem).

-------------- Tests:
-browser - alert doesn't show only in that browser
+browser - alert shows only in that browser
+all - works in all browsers
tested with non-existing file ("test") / tested with existing file

// +ie8 / with existing file -chrome
/*$script("", function() {
$script("test", function() {
alert("test");
});
});

// as above
$script("test", function() {
$script("", function() {
alert("test");
});
});*/

// -------------------------------------------

// -FF4 / +all
/*$script("test", function() {
$script("test", function() {
alert("test");
});
});*/


//2. -FF4 / +all
/*$script("test", "test");
$script.ready("test", function() {
alert("test");
});

*/

// -FF4 / +all
/*$script("test", function() {
alert("test");
});*/

//---------------------------------------

//1. -chrome
/*$script("", function() {
$script("", function() {
alert("test");
});
});

// -chrome
$script("", "test");
$script.ready("test", function() {
alert("test");
});

//3. -chrome
/*$script("", function() {
alert("test");
});*/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants