Hi,
Can we write javascript in iframe?
I want to call a external application javascript in my iframe of the jsp i am writing....issue is we can only have one call of this JS per page,now I am importing some html tags from a 3rd party which also does this Javascript call usig c:import...if this JS is called more than once my call will be ignored.
Only way that I have figured to fix it is by making these calls in separate iframes, by using iframes it appears to the external application that js is called by a separate page and it processes it.
So,what I am looking for is this:
1)First is there a way to do it w/o using iframe:
ex code:
//import a 3rd party url(<c:import url='url>) which has this script:
<script>
var="something"
call external js and pass this var
</script>
//this is inside my jsp
<script>
var1="something new"
call external js and pass this new var1
</script>
Now my call is ignored if i use say c:import to import first url...if i use iframe it works.
2.Now if i put my js script inside an iframe.
<iframe src="" width="0" height="0" frameborder="0" scrolling="No" marginheight="0" marginwidth="0" topmargin="0" leftmargin="0">
<html>
<head>
<script>
<language="javascript" src="some url"
</script>
</head>
<body/>
</html>
</iframe>
It doesn't work.
Please suggest.