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,
^ _ ^
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
...I found placing the javascript in the top container and not in the cfdiv itself solved many of my similar problems
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.
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.
Copy link to clipboard
Copied
I found placing the javascript in the top container and not in the cfdiv itself solved many of my similar problems
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,
^ _ ^
Copy link to clipboard
Copied
Odd indeed. My Console is empty.
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,
^ _ ^
Copy link to clipboard
Copied
Cool, WolfShade​. And subversive, too. You're making a ColdFusion UI desirable.
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,
^ _ ^