• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

VBscript not getting called/executed inside cfm page in Coldfusion2018, works well in CF11....

New Here ,
Jun 15, 2020 Jun 15, 2020

Copy link to clipboard

Copied

Hi

We are on CF11, upgrading to CF2018. Checking compatibility for CF2018

Below code works in CF11 but not in CF2018

 

I get 2 alerts in CF11 one - Welcome to VB Script and another as Welcome to Javascript.

but only 1 alert in CF2018 as Welcome to Javascript.

 

Below is my .cfm page....

 

<script language="vbscript" type="text/vbscript">
MsgBox("Welcome to VB Script")
</script>


<script language="vbscript" type="text/javascript">
alert("Welcome to Javascript")
</script>

Views

246

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 15, 2020 Jun 15, 2020

Copy link to clipboard

Copied

I'm not sure why that isn't working in CF2018, but you can remove the language and type attributes from the second one.  Language hasn't been used in years, and the default type is javascript.

 

Unless, of course, you're coding for outdated browsers.  🙂

 

V/r,

 

^ _ ^

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jun 15, 2020 Jun 15, 2020

Copy link to clipboard

Copied

Are you testing this in IE 11 or earlier? The only browser that still supports VBScript is IE. I tried your code in IE and it works but in any other browser only the Javascript runs.

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 15, 2020 Jun 15, 2020

Copy link to clipboard

Copied

LATEST

Adding to what others have said, I suppose there's a chance that you offered some CFML other than that HTML and Javascript. In case that's so, note that there is a "code" icon here in the editor for providing code (5th from the right in the list of icons as I see them now). It formats it distinctly and ensures that code is not list. Here's an example:

<cfif yourcode is "here">
   Then it appears separately formatted
</cfif>

 

Hope that may help. And if this is not the issue, please clarify what about the code you shared "doesn't work" in CF2018, since there's no CFML in it which CF would process. Also, let us know if you're using your browser's developer tools feature to try to observe what's going on. If you don't know what that means, it's ok. Just let us know either way. Thanks.


/Charlie (troubleshooter, carehart.org)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation