473,769 Members | 5,131 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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="javasc ript: GoTo( "/page.aspx" );">page</a>
....

Any ideas or suggestions for this?

Thanks,

bill
Nov 19 '05 #1
3 2939
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_fdrs ucks.com> wrote in message
news:%2******** *********@TK2MS FTNGP11.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="javasc ript: 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******** ******@tk2msftn gp13.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_fdrs ucks.com> wrote in message
news:%2******** *********@TK2MS FTNGP11.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="javasc ript: 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="javas cript">
window.Literal1 = "this uses' special chars/n";
</script>
......
<a onclick="CallWi thGlobalLiteral (window.Literal 1)">page</a>
-- bruce (sqlwork.com)
"William F. Robertson, Jr." <theman_at_fdrs ucks.com> wrote in message
news:%2******** *********@TK2MS FTNGP11.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="javasc ript: 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
3937
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 somehow to run code in vbscript and when it is executed back to javascript? Help is very much appreciated. Thanks! Peter
3
6787
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? What I have is a page heavy on the javascript that has a number of functions, one of which is to begin a visual countdown with an onclick and also open an asp page containing the server-side vbscript, which initiates a wake-on-lan call. I had no...
1
521
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 from the JavaScript routine. It doesn't matter whether the scripts are in external files, or embedded in the HTML document, so long as the VBScript is loaded before it is called from JavaScript - obviously. The VBScript routine can return a result...
7
21316
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 someone (client) that visits a web site through an anonymous proxy if this person ONLY has JavaScript enabled in their browser? This is NOT a question about PHP, perl, VBScript, Java(.class), or ActiveX. Let us _only_ deal with JavaScript for...
11
13405
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 pixels so that pictures on the page can be adjusted to better fit the display, Internet Explorer detects the coding and blocks it. Of course the user can click on the message displayed above the web page to allow "the active component" but many...
10
4706
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", you cannot use inline JavaScript statements that call setTimeout with functions that start with a double-underscore. This is very relavant to ASPX (ASP Dot Net) pages because it means that AutoPostBacks will fail since they generally call the...
9
8426
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
2400
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 that great. One of the cons of ASP & Javascript is that they're both interpreted, which means one has twice the amount of work to do interms of syntax checking & semantic/runtime checking. Another bad thing is that ASP & Javascript doesn't have...
5
9300
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 confirm('Do you really want to send this order ?);">
0
10210
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10039
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9990
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9860
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8869
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7406
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6668
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3955
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2814
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.