Solved

Javascript Question please!

Posted on 2004-08-09
7
306 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
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 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
This is an explanation of a simple data model to help parse a JSON feed
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

713 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