Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Javascript Question please!

Posted on 2004-08-09
7
Medium Priority
?
321 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 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

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

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

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

Make the most of your online learning experience.
If you are a mobile app developer and especially develop hybrid mobile apps then these 4 mistakes you must avoid for hybrid app development to be the more genuine app developer.
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 …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

972 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