Hi. I moving from ACF to Lucee 5.4.2.17 and have s...
# lucee
r
Hi. I moving from ACF to Lucee 5.4.2.17 and have some old parts of code where I use cfdiv and AjaxOnLoad in it 🤮. It doesn't work in Lucee and I don't know how to fix it.
Copy code
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>Document</title>
</head>
<body>
	<input type="text" name="param1" id="param1" value="" size="10" maxlength="10" />
	<cfdiv 
		bindOnLoad="false"
		bind="url:test20230727i.cfm?param={param1@change}" ID="thePBDiv"
	>
		static
	</cfdiv>
	<script>
		function finish() {
			console.log('finish');
		}
	</script>		
</body>
</html>
test20230727i.cfm
Copy code
<cfsetting showdebugoutput="false">
<cfcontent reset="true">
loaded ajax
<cfset AjaxOnLoad("finish")>
Function hasn't called. Is it bug or I do something wrong?
z
you can do that in 5 lines of jquery, avoid that old ajax crap
r
In DevTools I see these line
Copy code
<script type="text/javascript">Lucee.Events.subscribe(arguments.functionname,"onLoad");</script>
I believe that's incorrect and there should be "finish" instead of arguments.functionname, but I don't see any errors in console. I think script doesn't run
@zackster Yes, I can, but I already have more complicated code and don't need to rewrite it, just use existing. I know that cfdiv and another cfajax tags is hurt and bad things 🙂
z
are you running the latest version of the ajax extension?
I know @pothys-mitrahsoft fixed a few bugs with it
r
1.0.0.5
As I mentioned above I see bug here: https://github.com/lucee/extension-ajax/blob/master/source/functions/ajaxOnLoad.cfm It doesn't have ## for arguments.functionname. But I added this code to my file with correct function name and it didn't help me 😞