Solved

Javascript Question please!

Posted on 2004-08-09
7
265 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
  • 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 125 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
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

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 125 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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

A short article about problems I had with the new location API and permissions in Marshmallow
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
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 …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

744 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now