Link to home
Start Free TrialLog in
Avatar of alanc5
alanc5

asked on

Javascript Question please!

Boohoo , I'm having an issue, have a look at this:

<body>
<v:obj id="1" o:spt="142">
</body>

Question is, how on earth do you access the o:spt value through javascript? that just a normal html body tag...i can get the obj element through the id, but cant get at the o:spt bit.

Please help, I've hit a brick wall with this and cant move on.

Thanks.
Avatar of SCDMETA
SCDMETA

Try this:

      function showIt() {
            var xobj
            xobj = document.getElementById("1");            
            window.alert(xobj.getAttribute('o:spt'));
      }
Avatar of alanc5

ASKER

"value is null or not an object" or just plain "null" :o(

here's the complete test page:

<HTML
xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:o="urn:schemas-microsoft-com:office:office"
>
<HEAD>
      <META http-equiv="Content-Type" CONTENT="text/html; CHARSET=iso-8859-1">
      <TITLE></TITLE>
      <STYLE>
            P{ margin: 0px; }
            v\:* {behavior:url(#default#VML);}
            o\:* {behavior:url(#default#VML);}
            w\:* {behavior:url(#default#VML);}
      </STYLE>

</HEAD>
<BODY>

      <v:shapetype id="1" coordsize="" o:spt="142" adj="" path=""></v:shapetype>

<script>
      var el=document.getElementById("1");
      alert(el.getAttribute("o:spt"));
</script>
</BODY>
SOLUTION
Avatar of SCDMETA
SCDMETA

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of alanc5

ASKER

yeah thats what's causing me the heartache...but without that line the rest of the program falls over :o/

I cant think why that would cause that to happen.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of alanc5

ASKER

Thanks for trying guys, no matter what I try there's no way to modify that parameter and I cant check out the schema.  According to MS its read/write, but that's obviously not the case.

Hope you dont mind me splitting the points.

Regards,
Al
Yeah, well it says in the reference, the attribute is used internally whatever that means.

AJ