I have researched this a bit ad I am sure the question has been asked often, but the behavior I am getting does not seem to jive with what I am reading.
In my document head I have:
- <script type="text/javascript">
var DAbuttons = { "up" : "type=\"image\" src=\"/inc/DAbuttons/TopRowUp.gif\"", "down" : "type=\"image\" src=\"/inc/DAbuttons/BottomRowDown.gif\"", "update" : "type=\"image\" src=\"/inc/DAbuttons/UpdateRowOrder.gif\"" };
</script>
and in my script $(document).ready (below the above code but in the head) function I have:
-
if (typeof(DAbuttons) == "undefined") {
var DAbuttons = { "up" : "type=\"submit\"", "down" : "type=\"submit\"", "update" : "type=\"submit\"" }
}
but when I alert the value I see that the head code works, but it is undefined in the $(document).ready function. I have tried it with and without var in the head code, but no luck. The first instance should be a global definition, so I am at a loss how to resolve this.
Since someone will ask, the second code is delivered through a .js file and the head code is an override.
Any help would be appreciated.