Solved

assign value applet param through javascript

Posted on 2004-09-30
6
700 Views
Last Modified: 2008-02-01

i want to assign value to param "cookval" through javascript.
is there there any way like
document.formname.cv.value
since we can assign value to a text box by this method


<applet code=writefile.class  width=0 height=0 id=appwrite>
      <param name="cabbase" value="mycab.cab">
      <param id=cv name=cookval>
      </applet>

<a href="javascript:callme();">callme</a>

<script language="JavaScript">
function callme()
{
      //value to be assigned here
}
</script>
0
Comment
Question by:sandeepaher
6 Comments
 
LVL 36

Expert Comment

by:Zyloch
ID: 12197735
Hi sandeepaher,

Even if you affect the value of the param (which is possible), the outcome will not change because the applet is loaded once, then done. If you are considering this, check out MAYSCRIPT here: http://www.faqs.org/docs/htmltut/applets/_APPLET_MAYSCRIPT.html and http://java.sun.com/j2se/1.4.2/docs/guide/plugin/developer_guide/java_js.html

Regards,
Zyloch
0
 

Author Comment

by:sandeepaher
ID: 12197754
ok i realise this is illogical since the applet executes only once and it needs all the parameters then.
i need to do this in the applet itself i.e., reading cookies in applet.

actually the this is what the applet is supposed to do,
it should read the cookie and write the cookie information to a file on users machine.

can u tell me what is the method oreading and writing cookies in applet
0
 
LVL 36

Expert Comment

by:Zyloch
ID: 12197796
Unfortunately, my Java skills are quite elementary and amount to making Hello World programs or "Wow, I can change the System.out.print text and it will display differently!" programs. For more help with Mayscript, I recommend you post in the Java section or post a link pointer to this question in the Java section.

Regards...
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 28

Expert Comment

by:sybe
ID: 12198039
Well this is an old page of mine, explaining it a bit. http://utopia.knoware.nl/users/sybev/java/JSObject/JSObjectTrue.htm

The applet also needs to be programmed in such a way that it supports receiving data from javascript. Only then it can work. At least that used to be the case in times of IE4 and NS3.
0
 
LVL 25

Accepted Solution

by:
devic earned 500 total points
ID: 12198270
here is some trick.... I hope it will work ;)

================================
<div id=myCV>
<applet code=writefile.class  width=0 height=0 id=appwrite>
    <param name="cabbase" value="mycab.cab">
    <param id=cv name=cookval value="">
</applet>
</div>
<a href="javascript:callme('someNewVal');">callme</a>

<script language="JavaScript">
function callme(newVal)
{
      var m=document.getElementById("myCV");
      m.innerHTML=m.innerHTML.replace(/value="[^"]{1,}"/,'value="+newVal+"');
}
</script>
0
 
LVL 25

Expert Comment

by:devic
ID: 12198681
thank you sandeepaher!
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

In my daily work (mainly using ASP.net), I need to write a lot of JavaScript code. One of the most repetitive tasks I do are the jQuery Ajax calls. You know: (CODE) I don't know if for you it's the same, but for me is soooo tedious to write the …
Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

758 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

19 Experts available now in Live!

Get 1:1 Help Now