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

Execute Javascript within VBscript

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"); = 'red';
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 
  3.     var edit = igedit_getById("FG1010NItemD"); = 'red';
  5. End If 
Please Assist, Regards
Oct 14 '08 #1
Share this Question
Share on Google+
5 Replies

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

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. = 'red';
  6. }
  7. </script>
  9. If "aObjects("FG1020NShortD")" = "avar1" then
  10.  test();
  11. End If
Does not work - does not like the code, Please Assist!
Oct 14 '08 #3

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.

Oct 14 '08 #4

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.