I know this is a slightly older post, but another way you can approach this is to convert the data attribute value to a string:
$('#a').data("siteid").toString()
or
$('#a').data().siteid.toString()
Some examples of how this can work:
> (12345).toString()
"12345"
> (14.5).toString()
"14.5"
> (-14.5).toString()
"-14.5"
> "bob".toString()
"bob"
> (true).toString()
"true"
> ({a: "b"}).toString()
"[object Object]"
>(function(){console.log("bob")}).toString()
"function (){console.log("bob")}"
The parenthesis in the example are there to avoid assigning variables, since you cannot directly use #toString on the number directly: 123.toString(), but you can when it assigned to a variable or enclosed in parenthesis: (123).toString().
Just remember that you won't be able to convert null or undefined to a string.
Also something interesting happens with arrays and undefined and null values:
> (["bob", 123, true, null, undefined, this]).toString()
"bob,123,true,,,[object Window]"
S00005is used to force returning a string and that this should show that00005is converted to a number.