Home > AS/400 Tips > iSeries programmer tips > Debugging a Web page
iSeries 400 Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

ISERIES PROGRAMMER TIPS

Debugging a Web page


Andrew Borts
07.10.2006
Rating: --- (out of 5)


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



Andrew Borts
In my last tip, "Testing iSeries Web applications" we learned how to find out how to log who's using our Web sites, figure out what operating systems and browsers are being used and what resolutions are being used. We've also discussed the best way to track using a logging analysis application, how to choose the correct resolution for the overall appearance, and how to make sure what we're producing is formatted so the browsers can display it properly.

More Information
In this tip, I'll go into detail about the debugging of the Web page and the internal elements of the Web page -- the JavaScript. So let's start by debugging the "mess" we just developed.

The elements we need to concern ourselves with are:

  • The HTML on the page –- what's happening with it? (Covered in "Testing iSeries Web applications")

  • The Javascript on the page -- what's happening with it?

  • Last -- the CGI script itself

    So what tools are at our disposal for debugging Javascript? So far you've downloaded Firefox -- great tool, and you already have Internet Explorer -- so let's look into those.

    Built into Internet Explorer (IE) there are Javascript tools that are defaulted to be off when you get them.

    Go to Internet Options under tools;

    Then click advanced;

    Then look for "Disable Script Debugging" and turn them off.

    Also, "Display a notification about every script error" is optional to debug properly -- but not necessary. The goal is to have NO Javascript errors. This disrupts the users more then you realize.

    So now, it's debugging time. You have a problem, you just don't know what. Go to the "View" menu on top, and look for "Script Debugger." If you don't see it after performing the above setup, close ALL open Internet Explorer windows, and re-open it. It should appear after that. Then flag to break the page at the next Javascript statement. If there is an error on the page, the prompt will say "Error – would you like to Debug" then click OK or Cancel at that point. Right now, we're just hunting for problems…

    So, I hit F5 (refresh on AS/400 and on IE.)

    The prompt to debug the page appears, click Yes.

    Click OK to Step into the Script you're running.

    Now we're on a Microsoft Debug page -- one that is similar to VB's debugging page.

    The Yellow pointer on the left side, near the bottom, represents the location of the current line of code being executed…
    (example magnified)

    Now let's look at our primary debugging tools;

    I'm selecting a quick watch to look at a particular field within the "DOM" (refer to Javascript books for this) but you can look at fields by referring to their ID's, or window.document.etc, you can start by looking at window.document and drill down from there if you're totally lost. You can also set breakpoints.

    I set a breakpoint (the maroon dot) and hit F11 and then did a quick watch on the field I created within the Javascript. Javascript is a top down process when loading on the page, so understand that the code needs to be executed before you can see definitions, and/or results of the debugging process.

    When I perform my QuickWatch, you see my field has the date within it (note the code var theDate = new Date() was where the definition of theDate came from.

    OK, we've learned how to debug a Javascript page. To exit this debugging session, hit "Continue."

    Or hit the "X" on the upper right corner of the window (close window) and click "Yes."

    Done! Javascript Debuggers now?

    In the next tip, I'll show you some of Firefox's amazing built in tools.

    -----------------------------------------
    About the author: Andrew Borts is webmaster at United Auto Insurance Group in North Miami, Fla. He is often a frequent speaker at COMMON and is past president of The Southern National Users Group, an iSeries-AS/400 user group based in Deerfield Beach, Fla.

    Rate this Tip
    To rate tips, you must be a member of Search400.com.
    Register now to start rating these tips. Log in if you are already a member.


    Submit a Tip




    Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


    RELATED CONTENT
    iSeries programmer tips
    What is an integrated database?
    An automated CL method of moving a query from AS/400 to Excel
    Using SQL on System i to create multicolored comment lines
    Eight steps for creating program documentation using AS/400 utilities
    DAYSPAST CLLE program for AS/400: Compares object creation date with today's date
    Coloring source lines with COBOL and using a shortcut from within PDM
    Date calculation commands for AS/400
    There is very little RPG on System i can't do: From RPG nay to RPG yay!
    Using SQL on System i to color source code and inline comments
    Controlling spool files with APIs

    Debugging
    Space offset X'0015FF00' or X'0000000000000000' is outside current limit for object QIGC2424C
    Top 10 programmer tips YTD
    Top expert advice: 20 must-have programming tips
    Evaluate the value of a function in debug
    Too many handheld users crash the system
    Possible to create a user-defined option to be used in the debug mode?
    Space violation mystery solved
    Debug value of pointer
    How to use the ILE debugger to display the value of a variable in hexadecimal format
    How to debug a batch ILE RPG
    Debugging Research

    Web Development
    Application modernization strategies for System i
    RPG application modernization for i5
    Web skills crucial to iSeries programmer professional development
    System i Web interface could boost the platform
    Free System i development tools rebuttal
    COMMON product round-up: Modernizing the IBM System i
    Top 10 System i white papers
    Enterprise open source basics
    Make WebSphere work for you
    WebSphere for System i tutorial

    RELATED GLOSSARY TERMS
    Terms from Whatis.com − the technology online dictionary
    WebSphere Development Studio Client (WDSC)  (Search400.com)

    RELATED RESOURCES
    2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
    Search Bitpipe.com for the latest white papers and business webcasts
    Whatis.com, the online computer dictionary

    DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



  • iSeries Security - Security Tools, Physical Security and System Security
    HomeNewsTopicsITKnowledge ExchangeTipsBlogsAsk the ExpertsMultimediaWhite PapersProducts
    About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
    SEARCH 
    TechTarget provides enterprise IT professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective IT purchase decisions and managing their organizations' IT projects - with its network of technology-specific Web sites, events and magazines.

    TechTarget Corporate Web Site  |  Media Kits  |  Reprints  |  Site Map




    All Rights Reserved, Copyright 1999 - 2008, TechTarget | Read our Privacy Policy
      TechTarget - The IT Media ROI Experts