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

Playing around with CFDIV, and it's not working...

LEGEND ,
Nov 29, 2018 Nov 29, 2018

Copy link to clipboard

Copied

Hello, all,

I'm just playing around with CFDIV, seeing what is possible, and something is not working.

_any.cfm:

<cfoutput>This server is: #cgi.server_name#</cfoutput>

index.cfm:

<cfdiv id="testCFDiv" bind="url:_any.cfm" bindOnLoad="true"></cfdiv>

When I open index.cfm in a browser, I get a blank page.  Using F12, I can see:

<div id="testCFDiv"></div><!--- empty - nothing --->

Shouldn't the CFDIV be loading the contents of _any.cfm???

V/r,

^ _ ^

Views

467

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

correct answers 2 Correct answers

LEGEND , Nov 29, 2018 Nov 29, 2018

I think it has something to do with jQuery.  When I create a separate page and use the code, it works.

But when I open my original document, F12 it, and go to the console tab, I see the following:

Synchronus XMLHttpRequest on the main thread is deprecated because of it's detrimental effects to the end user's experience.  jquery-1.11.2.min.js: 4:25327

Query variable c not found.  jquery-1.11.2.min.js: 62:36

Array [ ]  jquery-1.11.2.min.js: 78:5

So this makes me think something is breaking in jQuery be

...

Votes

Translate

Translate
New Here , Jul 01, 2022 Jul 01, 2022

I found placing the javascript in the top container and not in the cfdiv itself solved many of my similar problems

Votes

Translate

Translate
Community Expert ,
Nov 29, 2018 Nov 29, 2018

Copy link to clipboard

Copied

I copied your exact code. When I launch index.cfm, it works as expected. I see

This server is: 127.0.0.1

Using F12, I also see a bunch of Javascripts that ColdFusion generated in the HTML head.

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
LEGEND ,
Nov 29, 2018 Nov 29, 2018

Copy link to clipboard

Copied

Odd.. I wonder why my code isn't working locally.

V/r,

^ _ ^

UPDATE: I, too, am seeing the JS that CF generates and includes.

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
New Here ,
Jul 01, 2022 Jul 01, 2022

Copy link to clipboard

Copied

LATEST

I found placing the javascript in the top container and not in the cfdiv itself solved many of my similar problems

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
LEGEND ,
Nov 29, 2018 Nov 29, 2018

Copy link to clipboard

Copied

I think it has something to do with jQuery.  When I create a separate page and use the code, it works.

But when I open my original document, F12 it, and go to the console tab, I see the following:

Synchronus XMLHttpRequest on the main thread is deprecated because of it's detrimental effects to the end user's experience.  jquery-1.11.2.min.js: 4:25327

Query variable c not found.  jquery-1.11.2.min.js: 62:36

Array [ ]  jquery-1.11.2.min.js: 78:5

So this makes me think something is breaking in jQuery because the separate file isn't including jQuery.

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
Community Expert ,
Nov 29, 2018 Nov 29, 2018

Copy link to clipboard

Copied

Odd indeed. My Console is empty.

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
LEGEND ,
Nov 29, 2018 Nov 29, 2018

Copy link to clipboard

Copied

In this separate page, I'm having some fun!  This is pretty cool.  It's like another way to CFINCLUDE. 

<cfdiv id="cfDivTest" /><button id="bindCFDiv" type="button">CLICK</button>

<script>

     const CLICK = document.getElementById('bindCFDiv'),

          cfDivTest = document.getElementById('cfDivTest');

     CLICK.addEventListener('click',function(){

          ColdFusion.navigate('doit.cfc?method=cfDivTesting','cfDivTest');

          },true);

</script>

doit.cfc:

<cffunction name="cfDivTesting" access="remote" returntype="string" returnformat="plain">

     <cfsavecontent variable="thisSession"><cfdump var="#session#" /></cfsavecontent>

     <cfreturn variables.thisSession />

</cffunction>

Pretty straightforward, kinda cool.  (I love learning new stuff.)

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
Community Expert ,
Nov 29, 2018 Nov 29, 2018

Copy link to clipboard

Copied

Cool, WolfShade​. And subversive, too. You're making a ColdFusion UI desirable.

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
LEGEND ,
Nov 30, 2018 Nov 30, 2018

Copy link to clipboard

Copied

GASP!  No way! 

I've never really delved into any of the JavaScript CF capabilities.  Which is odd, considering how much I love JS.

However, I am well aware that ACF uses an outdated Ext.js, which sucks (both Ext and outdated), but what can one do?

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
Resources
Documentation