?
Solved

Javascript Question please!

Posted on 2004-08-09
7
Medium Priority
?
313 Views
Last Modified: 2010-04-17
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.
0
Comment
Question by:alanc5
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
7 Comments
 
LVL 6

Expert Comment

by:SCDMETA
ID: 11758899
Try this:

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

Author Comment

by:alanc5
ID: 11758941
"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>
0
 
LVL 6

Assisted Solution

by:SCDMETA
SCDMETA earned 375 total points
ID: 11758979
Just FYI..when I remove this line (and add an </HTML> tag) it works.

v\:* {behavior:url(#default#VML);}

Not sure why that would affect it though.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:alanc5
ID: 11759013
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.
0
 
LVL 4

Accepted Solution

by:
aratani earned 375 total points
ID: 11759369
After a lot of digging through VML code this is what I came up with,

http://msdn.microsoft.com/library/default.asp?url=/workshop/author/vml/shape/a_spt.asp

This says that you should be able to access using the following format in a script,

el.spt

This is all I could come up with. I hope this helps you,

AJ
0
 

Author Comment

by:alanc5
ID: 11764242
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
0
 
LVL 4

Expert Comment

by:aratani
ID: 11764276
Yeah, well it says in the reference, the attribute is used internally whatever that means.

AJ
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A short article about problems I had with the new location API and permissions in Marshmallow
Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
Starting up a Project

718 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question