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

290

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
community guidelines

correct answers 1 Correct Answer

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:25327Query variable c not found.  jquery-1.11.2.min.js: 62:36Array [ ]  jquery-1.11.2.min.js: 78:5So this makes me think something is breaking in jQuery be...

Likes

Translate

Translate
Adobe Community Professional ,
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.

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
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.

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

^ _ ^

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
community guidelines
Adobe Community Professional ,
Nov 29, 2018 Nov 29, 2018

Copy link to clipboard

Copied

Odd indeed. My Console is empty.

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

^ _ ^

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
community guidelines
Adobe Community Professional ,
Nov 29, 2018 Nov 29, 2018

Copy link to clipboard

Copied

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

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

Copy link to clipboard

Copied

LATEST

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,

^ _ ^

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
community guidelines