How do I get the current record ID in a script?

Hopefully a fairly simple question:  I am modifying an AJAX js for a quote building tool, that pops out product creation to a child window that lets me build a product from several options.  The problem, is that I cannot figure out how to send the current record ID to the external page so it can put the product in the database.  I can usually get this from the document.uri with some trimming, but I notice that doesn't have the record ID when coming in from the detail view to the edit view.  Is there an easy way to do this, or should I just also modify the PHP to create an easily acces

  • Nevermind, I just added a hidden field with an actual ID to the edit view PHP, then used getelementbyid to do it.

    For anyone else looking, I added:

    $html .= '<input type="hidden" name="record" id="recordidhidden" value="'.$focus->id.'" />';

    to the php and

    var quoteid = document.getElementById("recordidhidden").value;

    to the js file.