jscolor referenced in 2 scenarios
===

Kinda crazy, please stay with me `: )`
I am using jscolor. I am experience 2 different behaviors, one of which I don't understand. 

All I'm trying to do is get the background color from a `<TD>` element of a `<Table>` and show the color value in a jscolor textbox.

The first code section below shows the correct behavior


        </form>
        <script type="text/javascript">
            var pageDefault = {
                tdtarget: document.getElementById('targetTD'),
                bg: document.getElementById('txtBGColor'),
                init: function() {
                    pageDefault.bg.value = pageDefault.tdtarget.getAttribute('bgcolor');// "#ffcc99";
                }
            }
            pageDefault.init();
        </script>      
    </body>



The following is the 2nd scenario which baffles me.


I have a JavaScript reference that references an aspx page like so:

    <script type="text/javascript" src="myjavascript.js.aspx"></script>

Here is that aspx page with only JavaScript in it.

    <%@ Page Language="C#" EnableSessionState="True" CodePage="65001" UICulture="auto" %>
    
    <%
        Response.ContentType = "text/javascript";
    %>
    
    function reflectColor(){
        var bg = document.getElementById('txtBGColor');
        var tdtarget = document.getElementById('targetTD');
        bg.value = tdtarget.getAttribute('bgcolor');
    }

![enter image description here][1]


  [1]: http://i.stack.imgur.com/jMwUk.png