Results 1 to 2 of 2

Thread: Spry script error

  1. #1
    Junior Member Newbie
    Join Date
    Sep 2008
    Posts
    1

    Angry Spry script error

    I am new to spry and am creating a webpage with multiple spry tables on it. I got the first table in and it works fine, but when I went to add the second table I receive this error: I included the portion of the script file that it says is causing the error and have italicized the line where it says the error is occuring.
    while executing onClick in InsertSpryDataTable.htm, the following JavaScript error(s) occurred:
    At line 1445 of the file "C:\Program Files\Adobe\Adobe Dreamweaver CS3\Configuration\Common\Scripts\spry_ajax_utils.j s": offsetstoNode: Argument number 1 is invalid.

    function ajaxUtils_promptForSpryRegion(codeOffsets)
    {
    var bAddSpryRegion = false;
    var bIsInsideSpryRegion = false;
    var aDOM = dw.getDocumentDOM();
    if (aDOM)
    {
    var origStartOffset = -1;
    var origEndOffset = -1;
    if (codeOffsets)
    {
    origStartOffset = codeOffsets.startoffset;
    origEndOffset = codeOffsets.endoffset;
    }
    else
    {
    var selection = aDOM.getSelection();
    origStartOffset = selection[0];
    origEndOffset = selection[1];
    }
    var currNode = aDOM.offsetsToNode(origStartOffset,origEndOffset);
    if (currNode != null)
    {
    var aParentNode = currNode;

    Thanks in advance for your help.

  2. #2
    Senior Member Power Poster
    Join Date
    Dec 2007
    Posts
    359

    Default

    It appears as though you are working with Adobe's Spry AJAX framework (these forums are primarily intended for the discussion of Spry Hosting - unaffiliated with Adobe).

    My best recommendation would be to review the Spry AJAX Framework Documentation and try modifying your code to debug the origStartOffset variable:

    Code:
    function ajaxUtils_promptForSpryRegion(codeOffsets)
    {
    var bAddSpryRegion = false;
    var bIsInsideSpryRegion = false;
    var aDOM = dw.getDocumentDOM();
    if (aDOM)
    {
    var origStartOffset = -1;
    var origEndOffset = -1;
    if (codeOffsets)
    {
    origStartOffset = codeOffsets.startoffset;
    origEndOffset = codeOffsets.endoffset;
    }
    else
    {
    var selection = aDOM.getSelection();
    origStartOffset = selection[0];
    origEndOffset = selection[1];
    }
    // Debugging
    alert('origStartOffset value: ' + origStartOffset);
    // End Debugging
    var currNode = aDOM.offsetsToNode(origStartOffset,origEndOffset);
    if (currNode != null)
    {
    var aParentNode = currNode;

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •