pkdevbox / iui

Automatically exported from code.google.com/p/iui
MIT License
0 stars 0 forks source link

Disable console.log statements (shows up with Ajax hyperlinks on 0.40-alpha1 and 0.40-dev3) #308

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

Ajax Hyperlinks don't seem to be working anymore on 0.40-dev3. The following 
works fine on 0.40-dev2, but links don't work on 0.40-dev3.

main.html:

<!DOCTYPE html>
<html>
<head>
   <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
   <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"/>
   <link rel="stylesheet" href="iui/iui.css" type="text/css" />
   <link rel="stylesheet" href="iui/t/default/default-theme.css" type="text/css"/>
   <script type="application/x-javascript" src="iui/iui.js"></script>
</head>
<body>
   <div class="toolbar">
      <h1 id="pageTitle"></h1>
      <a id="backButton" class="button" href="#"></a>
   </div>
   <ul id="main" title="Main" selected="true">
      <li><a href="screen1.html">Go to Screen #1</a></li>
   </ul>
</body>
</html>

screen1.html:

<div id="screen1" class="panel" title="Screen 1">
<ul><li>Hello 1</li></ul>
</div>

What is the expected output? What do you see instead?

I expect the link to work (it does on 0.40-dev2).

What version of the product are you using? On what operating system?

0.40-dev3, Firefox 3.6.23 on Windows XP.

Please provide any additional information below.

Original issue reported on code.google.com by guille.r...@gmail.com on 30 Sep 2011 at 11:58

GoogleCodeExporter commented 8 years ago
Just tested on 0.40-alpha1, doesn't work either.

Original comment by guille.r...@gmail.com on 30 Sep 2011 at 12:00

GoogleCodeExporter commented 8 years ago
Yikes!  Do you have a live URL I can test this on?  When you say the links 
"don't work" what do you mean?  What happens?  Nothing?  Have you looked in a 
browser debugger for error messages, etc?

Original comment by msgilli...@gmail.com on 30 Sep 2011 at 4:59

GoogleCodeExporter commented 8 years ago
Ajax links work fine in 0.40-alpha1 in the music sample, here:
http://iui.googlecode.com/hg-history/REL-0.40-alpha1/web-app/samples/music/music
.html

Original comment by msgilli...@gmail.com on 30 Sep 2011 at 5:24

GoogleCodeExporter commented 8 years ago
They also work fine here:
http://iui.googlecode.com/hg-history/REL-0.40-alpha1/web-app/test/link-types.htm
l

(Although I haven't tested with Firefox 3.6 on Windows XP)

Original comment by msgilli...@gmail.com on 30 Sep 2011 at 5:27

GoogleCodeExporter commented 8 years ago

Original comment by msgilli...@gmail.com on 30 Sep 2011 at 5:57

GoogleCodeExporter commented 8 years ago
Hello. With "don't work" I mean that the new page does not load. The "spinning" 
image is shown but it keeps spinning forever.

I tried the two URLs you posted. Regular links work fine, Ajax links (e.g. the 
"Stats" link in the music demo or the "Ajax links" in the Link types demo) do 
not.

Looking at the Firefox javascript console, each time I click on one of those 
the following is logged three times:

Error: console is not defined
Archivo de origen: 
http://iui.googlecode.com/hg-history/REL-0.40-alpha1/web-app/iui/iui.js
Línea: 258

This is the following line in showPageByHref:

console.log("xhr.readyState = " + xhr.readyState);

Perhaps this is the cause of the problem.

As a side note: Once I click on one of these Ajax links the spinner keeps 
spinning forever and the page does not load, but more importantly -- once I get 
into this state none of the other links work either. The only option seems to 
be to reload the whole page.

Original comment by guille.r...@gmail.com on 3 Oct 2011 at 6:16

GoogleCodeExporter commented 8 years ago
Thanks.  In your app or local copy, try either deleting line 258 or commenting 
it out with //

We need to turn off all console.log statements in the next release.  Sorry 
about that.

Original comment by msgilli...@gmail.com on 3 Oct 2011 at 6:31

GoogleCodeExporter commented 8 years ago

Original comment by msgilli...@gmail.com on 3 Oct 2011 at 6:31

GoogleCodeExporter commented 8 years ago
Yes, commenting out the console.log line makes the link work.

I would like to suggest to use try..catch blocks so that in case of something 
going wrong, the iui.busy flag is not kept set forever.

In my case, the call to console.log caused an exception and from then on, no 
links on the page would work anymore (because iui.busy flag was set). This can 
be easily avoided:

    showPageByHref: function(href, args, method, replace, cb)
    {
            try
            {
                [...rest of the code...]
            }
            catch (err)
            {
                iui.busy = false;
            }
    },

Original comment by guille.r...@gmail.com on 3 Oct 2011 at 7:27

GoogleCodeExporter commented 8 years ago
Thanks for following up.   Thanks also for suggesting the try..catch block -- 
the busy flag makes that a really good idea.

Original comment by msgilli...@gmail.com on 3 Oct 2011 at 4:54

GoogleCodeExporter commented 8 years ago
We'll use Issue #25 for tracking the try/catch work.  (And I'm changing the 
summary of this one to indicate that the console.log is, in fact, the problem)

Original comment by msgilli...@gmail.com on 3 Oct 2011 at 5:01

GoogleCodeExporter commented 8 years ago
Short-term fix (commenting out 2 console.log statements) is checked into source 
control:
http://code.google.com/p/iui/source/detail?r=da4b81fa4b508a8bad8cb2b40c0784475a0
7fe47

(first iUI change checked in to source control since we switched to Git)

Original comment by msgilli...@gmail.com on 4 Oct 2011 at 5:21