Console :: Log Cancels Loop When Firebug Disabled?
Nov 30, 2009
Is this a bug or a feature? In this code:
Code:
for (var ur=longestRow; ur>1; ur-- ) // adjust rows above it
{ console.log("going to call spaceRowAbove("+ur+")");
spaceRowAbove(ur);
}
If Firebug is enabled the message is logged and the function is executed.If Firebug is NOT enabled, the function is not executed.If the log statement is commented out, the function IS executed.Wouldn't it be more reasonable for the interpreter to ignore just the console call, rather than the whole loop?Or is it just me and my Firefox 3.5.5?
I have firebug installed in my firefox browser, but I can't get console.log, console.debug or console.trace to work. My console window remains empty despite all my efforts. For example I have some code which throws up an alert box ( alert ('here is an alert') so I know 100% that it is being executed. If I now place the line console.log("please log this to the console");next to it, nothing gets written to the console. I also have firephp installed and this is logging to the console for my php code absolutely fine
i'm trying to make jquery UI's button and dialog plugins work with my form. i want the reset button
[Code]...
then on a Continue response the button should continue with its original purposewhich doesn't happen. i get a return: false type of behavior w/o return: false anywhere. can anyone point me in the right direction?
I have a loop in Javascript, I want to run console.log() in a specific iteration, and then terminate. What is the best method to go about doing this? I'm wanting something like Perl's
I'm just getting started with nodejs. For now my purpose with this tech is to finish a book (The Definitive Guide to HTML5) where it's covering ajax and is using node.js to send the code back. I do want to learn the basics while I'm at it.
What I have so far: I understand that node.js lets me write my own web server. I understand that nodejs is actually 'C' and it just allows for us to write JS to make a web server and do other back-end tasks.
I've installed node.js on my windows 7 64 bit machine. I have found out that I can run a script on a node by right clicking it and selecting open with "Evented I/O for V8 Javascript".
What I want to know is how do I run node from the command line? What are the boundaries of the JS file that I write? From what I can tell, I can goo all over the place with my js file traversing my filesystem as I please. If this is true, how is it safe? It seems like it would be easy to hijack some simple js file and go all over the servers file system at will for a hacker....If someone could fill in these holes.
The XXX function here would interpolate the values of any variables named with a @ prefix into the string. Why @? Why not?
So using my favorite JavaScript console (FireBug), I typed the following and ran it:
x = "hello world"; y = 42; z = "--@x/@y--"
z = z.replace(/@(w+)/g, function (dummy, v) { return eval(v); });
alert(z);
And it works. The alert box shows "--hello world/42--" as expected. Okay, so now let's turn it into a function:
x = "hello world"; y = 42;
function XXX(s) { return s.replace(/@(w+)/g, function (dummy, v) { return eval(v); }); }
alert(XXX("!!!@x~~~@y!!!"));
And again, it works. The alert box shows "!!!hello world~~~42!!!" as expected. I should be able now to just drop this *same* code into a <scriptsection of a web page, right?
Wrong. If I take the *same* code as my second example and plop it in a web page, the alert does not show the same thing as when in FireBug's console. It shows the same string passed to XXX, unchanged.
Other experimentation tells me that when placed in a web page, the anonymous function to do the eval call is never invoked, which suggests that the regular expression didn't match.
I've only tried this in FireFox 2 and IE 7, but if it doesn't work properly in either of those, I really don't care about the other browsers.
My guess is there is a difference in the execution environment of FireBug's console (or likely, any JavaScript console) and the execution environment of a web page. The questions are what is that difference, and how do I make my XXX function work properly?
<script> $('#text').load('test.html h1'); // loads h1 content out of test.html - works fine $('#text h1').append('test'); // should append 'test' to h1 - does nothing!
Firefox has a Javascript Console that has 3 panels besides "All" and "Clear": "Errors", "Warnings", "Message".
Does anyone know a way to log a message in the Message panel with JavaScript? That would really help debugging. I know there's a way involving XPCOM, but that only works with "trusted" scripts, and scripts loaded thru html aren't trusted.
I am getting $document.ready(function() not defined in the firebug console. I have seen that in most cases this is caused when the jQuery core is missing or the path is invalid. I do not believe this is the problem in my case becuase firebug shows the code as being loaded successfully and it is readable.
I have the following scripts in my head; <script type="text/javascript" src="jquery-1.4.2.min.js"></script> <script type="text/javascript" src="jquery.validate.js"></script> <script type="text/javascript"> jQuery.validator.addMethod( "selectNone", function(value, element) { if (element.value == "none") { return false; }}, .....
Any of you know how can I stop an exit console when the visitors lefts my site trough a form button?
The below code is the function that opens the console or popup. ********************************** <script language="JavaScript"> function exit(){ window.open('XXXXXXX');} </script> **********************************
Then on the body tag ************************ <body onUnload="exit()"> ************************
I'm having a weird problem using ajax. I use ajax to create a input field inside a form.
like this:
Before Ajax script
Code:
After Ajax script
Code:
The Ajax script works perfectly. the problem occurs when I try to send the form with the new field. The form doesn't send the field data to test.php. And more weird is that it works on IE, only on FF the problem occurs. Nothing shows in the Errors Console, and I have the last Firefox version.
I am working on a form inside my administration console to upload images with PHP. In my form I have the following:
[Code]...
The onchange submits the form to a seperate PHP file (sent in the action of the form) dedicated to handling the uploading of the images, while the submit button(not shown in code) will submit the rest of the form through ajax. In order to use 1 file field, Ive read that to get an ajax looking effect I need to use an iframe, so I added the IFrame into the HTML and got the effect working right (without actually uploading the files.)
Now I want to limit the ammount of images to 8. Which is where the hidden field came in. So i've got to figure out a way to count the successful uploads, or add them as we go. At which time that number turns to 8, the script will disable the file field from anymore uploads. Problem is I have no clue where I need to go within my php file to make this happen. Here is my php file with javascript added in:
Code: <?php // lets go ahead and get this image uploaded ?> <script language="JavaScript" type="text/javascript"> var parDoc = window.parent.document; var upldcnt = parDoc.getElementByID('upload_cnt').value; [Code]....
I have been looking at this code for two evenings now, and rewrote it 4 times already. It started out as jQuery code and now it's just concatenating strings together.
What I'm trying to do: Build a menu/outline using unordered lists from a multidimensional array.
What is happening: Inside the buildMenuHTML function, if I call buildMenuHTML, the for loop only happens once (i.e. only for 'i' having a value of '0'.) If I comment out the call to itself, it goes through the for loop all 3 times, but obviously the submenus are not created.
I'm looking to send a loop variable (i) to a function inside the loop, but I can't seem to get it to use the value I want, it keeps making it a reference of i and therefore the function is always called using the last value of i rather than the one it was set with.
So if i have 5 Tabs then Tab 1, when clicked, should call DefaultTabClick(0) and so on rather than always using 4 for any of the tabs.
I'm rookie when it comes to Ajax and jQuery an..The following url produces an xml-file that I want to use on my page:When I use firebug it seems like nothing comes back. What have I done wrong?
This is what my code looks like: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">