Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Javascript debug trace

Status
Not open for further replies.

Targol

Technical User
Sep 13, 2002
908
FR
I have a javascript that is dynamically created by my framework. I want to check that javascript content in order to debug it. What I do for the momoent is an "alert(response);" before sending the response. My problem is that the response content is so big that the alert box cuts it before the info I need to check. Does anyone has a clue to override that problem (tracing the response to a file, a console or anything else on which I'll be able to see all the response content) ?

Thanks in advance for any kind of help.

Water is not bad as long as it remains outside human body ;-)
 
there are several option, you can dump the debug into a textarea for example or you can use Firefox/Netscape's Javascript debugger which will allow you to step through the code just like Visual Studio.
 
Well, thanks for your answer. I already tryed Firefox javascript debugger but it dosn't work on dynamically created JS. By the way, I managed to solve my problem using a dirty but eficiency method to replace the "alert(response)" : I coded a Js function like this :
Code:
function traceLongString(trace2Cut, separator) {
  var str = new String(trace2Cut)
  var list= str.split(separator)
  for (i = 0; i < list.length; i++) {  
    alert(list[i]);
  }
}

Water is not bad as long as it remains outside human body ;-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top