Highlighted

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

New Here ,
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

104

Likes

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

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

New Here ,
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

105

Likes

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
Jun 15, 2020 0
LEGEND ,
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,

 

^ _ ^

Likes

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
Reply
Loading...
Jun 15, 2020 0
Participant ,
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.

 

Likes

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
Reply
Loading...
Jun 15, 2020 1
Adobe Community Professional ,
Jun 15, 2020

Copy link to clipboard

Copied

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 (server troubleshooter, carehart.org)

Likes

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
Reply
Loading...
Jun 15, 2020 0