473,327 Members | 2,055 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

javascript and vbscript in the same page

My problem is I routinely use both vbscript and javascript (yes, that is a
problem in itself) on the same webpage. I feel placing the "javscript:" or
"vbscript:" on all my client side events is bloating the size of my page,
especially in my menu.

I am aware the "default" language of the page is the first defined script,
but I can not guarantee javascript will always be defined first. Is there a
way to wrap a block of html to have a default language? I was hoping to
accomplish this through a div wrapper, but that did not work.

I have about 17,000 links like this all in a row. Well, it really isn't
that many, but you can see the code bloat coming.

<a onclick="javascript: GoTo( "/page.aspx" );">page</a>
....

Any ideas or suggestions for this?

Thanks,

bill
Nov 19 '05 #1
3 2914
I suggest you just stop using client-side VB Script. Also, have you
considered using the href attribute of the <a> tag instead of using
JavaScript to provide navigation?

Ray at work

"William F. Robertson, Jr." <theman_at_fdrsucks.com> wrote in message
news:%2*****************@TK2MSFTNGP11.phx.gbl...
My problem is I routinely use both vbscript and javascript (yes, that is a
problem in itself) on the same webpage. I feel placing the "javscript:" or "vbscript:" on all my client side events is bloating the size of my page,
especially in my menu.

I am aware the "default" language of the page is the first defined script,
but I can not guarantee javascript will always be defined first. Is there a way to wrap a block of html to have a default language? I was hoping to
accomplish this through a div wrapper, but that did not work.

I have about 17,000 links like this all in a row. Well, it really isn't
that many, but you can see the code bloat coming.

<a onclick="javascript: GoTo( "/page.aspx" );">page</a>
...

Any ideas or suggestions for this?

Thanks,

bill

Nov 19 '05 #2
Ray,

I want to stop using it too, but we have lots and lots of vbscript export to
excel functions. And some of my developers are more comfortable with
vbscript. I am slowly converting them over to use javascript, but they came
from VB backgrounds, and I already used a lot of clout to change the site to
C# from VB.NET, so I am out of "bullets".

I am using the href tag (not in my sample), however it calls a function
name. This is a requirement of the system we have to differentiate between
the debug and release version of the build. We can change the vdir path
attribute and "/AP/Apdetails" will always go to the correct location client
side whether the path is http://dasc/ap/apdetails or
http://dascdev/test1/bob/AP/Apdetails without any code changes involving the
menu rendering.

So I am gathering it is not possible to set up a "block" of html to default
a specific language?

bill


"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
message news:eE**************@tk2msftngp13.phx.gbl...
I suggest you just stop using client-side VB Script. Also, have you
considered using the href attribute of the <a> tag instead of using
JavaScript to provide navigation?

Ray at work

"William F. Robertson, Jr." <theman_at_fdrsucks.com> wrote in message
news:%2*****************@TK2MSFTNGP11.phx.gbl...
My problem is I routinely use both vbscript and javascript (yes, that is a problem in itself) on the same webpage. I feel placing the "javscript:" or
"vbscript:" on all my client side events is bloating the size of my page, especially in my menu.

I am aware the "default" language of the page is the first defined script, but I can not guarantee javascript will always be defined first. Is

there a
way to wrap a block of html to have a default language? I was hoping to
accomplish this through a div wrapper, but that did not work.

I have about 17,000 links like this all in a row. Well, it really isn't
that many, but you can see the code bloat coming.

<a onclick="javascript: GoTo( "/page.aspx" );">page</a>
...

Any ideas or suggestions for this?

Thanks,

bill


Nov 19 '05 #3
you can try to keep the onclick code language independent, in your sample:

<a onclick="GoTo( "/page.aspx" )">page</a>

will work no matter the current language or what language GoTo is written
in. if you have to pass "this" you are stuck, but funny can be done this
way:

<script language="javascript">
window.Literal1 = "this uses' special chars/n";
</script>
......
<a onclick="CallWithGlobalLiteral(window.Literal1)">p age</a>
-- bruce (sqlwork.com)
"William F. Robertson, Jr." <theman_at_fdrsucks.com> wrote in message
news:%2*****************@TK2MSFTNGP11.phx.gbl...
| My problem is I routinely use both vbscript and javascript (yes, that is a
| problem in itself) on the same webpage. I feel placing the "javscript:"
or
| "vbscript:" on all my client side events is bloating the size of my page,
| especially in my menu.
|
| I am aware the "default" language of the page is the first defined script,
| but I can not guarantee javascript will always be defined first. Is there
a
| way to wrap a block of html to have a default language? I was hoping to
| accomplish this through a div wrapper, but that did not work.
|
| I have about 17,000 links like this all in a row. Well, it really isn't
| that many, but you can see the code bloat coming.
|
| <a onclick="javascript: GoTo( "/page.aspx" );">page</a>
| ...
|
| Any ideas or suggestions for this?
|
| Thanks,
|
| bill
|
|
Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Peter | last post by:
Hello! Please, could anyone say, can one combine javascript and vbscript in same asp page? I am in situation where I must run some code in javascript and some of it in vbscript. Can I change...
3
by: David Shorthouse | last post by:
Hey folks, Not an off-topic posting.....since I was shot-down in an earlier post...this one's legit. How do I go about calling a server-side vbscript within a client-side javascript function?...
1
by: Ian Sedwell | last post by:
Hi guys Many thanks to all who replied to my original question. Actually, it's dead easy and the way I was doing it was correct the first time. You do indeed simply call the VBScript routine...
7
by: Privacy Advocate | last post by:
//crossposted to: comp.lang.javascript, alt.comp.lang.javascript in an effort to get factual answers from JavaScript experts// Simply put; Is it possible to obtain the real (actual) IP address of...
11
by: Doug van Vianen | last post by:
Hi, I often like to include some JavaScript coding in my web pages to make them more interesting. Unfortunately, even when this coding is as simple as a check to see what the display width is in...
10
by: Shadow Lynx | last post by:
That subject packs a whallop, so let me explain in better detail what's happening and how it relates to ASPX pages... In a nutshell, if the first <script /on a page is of type "text/vbscript",...
9
by: Erwin Moller | last post by:
Hi, Can anybody comment on this? In comp.lang.php I advised somebody to skip using: <script language="javascript"> and use: <script type="text/javascript"> And mr. Dunlop gave this response:
18
by: Andrew Wan | last post by:
I have been developing web applications with ASP & Javascript for a long time. I have been using Visual Studio 2003.NET. While VS2003 is okay for intellisense of ASP & Javascript, it's still not...
5
by: Tomislav | last post by:
Hello, I tried to use "javascript:return confirm();" function in following manner ( triggered by form onSubmit event ): ** <form method="post" action="mail.php" onSubmit="javascript:return...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.