By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,848 Members | 3,223 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,848 IT Pros & Developers. It's quick & easy.

Execute Javascript within VBscript

100+
P: 200
Hi, I need help please:

The foll code works within a WebTextEdit - ClientSideEvents: (javascript)
Expand|Select|Wrap|Line Numbers
  1.   var edit = igedit_getById("FG1010NItemD");   edit.Element.style.backgroundColor = 'red';
  2.  
I need to execute this code within a VBscript code window:

I would like to add the above code & set the WebTextEdit object:

Expand|Select|Wrap|Line Numbers
  1. If "aObjects("FG1010NItemD")" = "avar1" then 
  2.  
  3.     var edit = igedit_getById("FG1010NItemD");      edit.Element.style.backgroundColor = 'red';
  4.  
  5. End If 
Please Assist, Regards
Oct 14 '08 #1
Share this Question
Share on Google+
5 Replies


acoder
Expert Mod 15k+
P: 16,027
Put those two statements in a JavaScript function and then call that within the VB code.
Oct 14 '08 #2

100+
P: 200
Thanks but how do I do this:

Within a Vbscript window:

Expand|Select|Wrap|Line Numbers
  1. <script language="javascript"> 
  2. function test()
  3. {
  4. var edit = igedit_getByI("FG1020NShortD");
  5. edit.Element.style.backgroundColor = 'red';
  6. }
  7. </script>
  8.  
  9. If "aObjects("FG1020NShortD")" = "avar1" then
  10.  test();
  11. End If
  12.  
  13.  
Does not work - does not like the code, Please Assist!
Oct 14 '08 #3

acoder
Expert Mod 15k+
P: 16,027
As a full member now, you should know that we expect your code to be posted in [code] tags (See How to Ask a Question).

This makes it easier for our Experts to read and understand it. Failing to do so creates extra work for the moderators, thus wasting resources, otherwise available to answer the members' questions.

Please use the tags in future.

Moderator.
Oct 14 '08 #4

acoder
Expert Mod 15k+
P: 16,027
The VB-script code must appear within script tags (like JavaScript code).
Oct 14 '08 #5

rnd me
Expert 100+
P: 427
looks like you have too many quotes in the vbscript code.
Oct 14 '08 #6

Post your reply

Sign in to post your reply or Sign up for a free account.