div ?

J

Jarod

Hey
I need to put div like this :
<div id="ws" style="behavior:url(webservice.htc)"/>
but I can't put in body because I need to use frames. And even if I create a
body tag this div doesn't execute. It can execute even in some .js files if
you now the way ? But the main question is where to put it so browser will
execute it ? Because if I have it in my header it doesn't work ;(
Jarod
 
K

Kevin Spencer

You're kidding, right?

ASP.Net is a technology for programming web applications. A web application
is a rather complex animal that creates an interactive web site using
server-side object-oriented programming with the .Net framework, which
renders client-side HTML, CSS, JavaScript, Cookies, Images, and the whole
gamut of those client-side web technologies that make up what is commonly
known as a web page. So, in order to write an application that renders HTML,
CSS, JavaScript, Cookies, Images, and the whole gamut of those client-side
web technologies, it would be logical to assume that one would have at least
a smattering of knowledge about those technologies. It sounds to me like
you're trying to perform calculus without having studied multiplication
first. It might be a good idea to back up a little. Eating an entire
elephant at one sitting is difficult, to say the least.

In answer to your question, which concerns adding a div that has a CSS style
which calls a JavaScript behavior to a page, I might first point out that
the div in question has an external dependency on a JavaScript behavior. Do
you know anything about where that behavior might be found? Well, we can
deal with that tusk later.

You say you "need to use frames." Well, you really *are* a masochist, aren't
you? I hope you realize how frames and framesets in an ASP.Net application
add to the complexity and difficulty of writing one. But I'm not really
concerned about that. It is just another nail in the proverbial coffin in
this case. So, you want to use a frameset. Now, a frameset is an HTML
construct. It is an HTML document which, when loaded into a browser
instance, enables that browser instance to load multiple *other* HTML
documents into multiple windows (frames) defined in the frameset document.
This means that all a frameset renders is a bunch of frames. That's it. End
of story. Now, a div is an interface element which renders a box. As a div
is not a frame, it isn't going to appear anywhere in the frameset. No amount
of coaxing will change this. And as the <head> of an HTML document has
absolutely no interface in the document, well, fill in the rest. However, as
a frameset *contains* other HTML documents, one in each frame, the div can
be placed into one of these other documents.

Now, as to "so the browser will execute it," well, a browser doesn't execute
a div. It *can* execute a JavaScript behavior. That is, if you set up the
behavior correctly.

Still, if I were you, I would stop right now, before you go any further. You
are attempting to build a skyscraper, and you don't know what a brick is. I
think maybe a few bird-houses would be a better place to start. Work your
way up from there. It will be much less frustrating.
 
J

Jarod

Did you read my question ? I didn't ask how to write asp.net handler that
would render whole page for me and so on... I just need to put somewhere in
HTML ( in aspx file ) a <DIV>. This div gives me access to webservice from
clientside... But the problem is the only way it works is in <body>
<div ... />
</body> ... And my problem again I am using frames and there is no body. So
where to put that div ?

I found some solution ;) It was a iframe instead of frames but I still
prefere a frames so If anybody knows where put <div> please tell me.
Jarod
 
K

Kevin Spencer

Did you read my question ?
....
If anybody knows where put <div> please tell me.

Did you read my answer? I told you to put it in one of the HTML documents
loaded into the FrameSet.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
If you push something hard enough,
it will fall over.
- Fudd's First Law of Opposition
 
J

Jarod

If anybody knows where put said:
Did you read my answer? I told you to put it in one of the HTML documents
loaded into the FrameSet.

Yeah, but there is a problem. I need to have access to it from the script
that is on the page with framesets ( no body tag ).
Jarod
 
K

Kevin Spencer

<script type="text/javascript">
var elDiv = window.frames[0].document.getElementById("yourDivsId");
//...
</script>

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
If you push something hard enough,
it will fall over.
- Fudd's First Law of Opposition
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,777
Messages
2,569,604
Members
45,234
Latest member
SkyeWeems

Latest Threads

Top