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   



[TABLE]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.

[TABLE]

[IMAGE]
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;

    [TABLE]

    Then click advanced;

    [TABLE]

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

    [TABLE]

    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 "Sc


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


    RELATED CONTENT
    iSeries programmer tips
    Groovy programming on IBM i
    EGL Rich UI on IBM i: Do you Dojo?
    Running PHP open source applications: NOBODY needs authority
    Programming for the Web on the IBM i, what is possible
    Using geocoding on AS/400 to enhance your Web presence
    The best technologies and tools for System i programmers in 2009
    Seven IBM i project lessons learned in 2008
    Documenting nested program structures on the AS/400
    What is an integrated database?
    An automated CL method of moving a query from AS/400 to Excel

    Debugging
    How to resolve a CPI93B8 error message: LIC problem data has been logged for #MSTRTNS
    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
    Debugging Research

    Web Development
    IBM i shop boosts online sales with RPG-based Web platform
    Migrating from RPG to EGL on IBM i
    Groovy programming on IBM i
    Running PHP open source applications: NOBODY needs authority
    Zend Web software teams up with IBM System i
    The best technologies and tools for System i programmers in 2009
    Seven IBM i project lessons learned in 2008
    AS/400 lessons from the past, present, and future: A holiday tale
    Application modernization strategies for System i
    RPG application modernization for i5

    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


    ript 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…

    [TABLE]

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

    [TABLE]

    The prompt to debug the page appears, click Yes.

    [TABLE]

    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.

    [TABLE]

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

    [TABLE]

    Now let's look at our primary debugging tools;

    [TABLE]

    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.

    [TABLE]

    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."

    [TABLE]

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

    [TABLE]

    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




    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 technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

    TechTarget Corporate Web Site  |  Media Kits  |  Site Map




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