Are there best practices one should follow when adding custom Javascript to the editContent.aspx page? It seems as if my simple javascript is not functioning.
Why would you want to add javascript to that page? It's part of the Umbraco source and shouldn't be changed. Have you tried adding javascript with a custom datatype?
Yes, so to clarify, I am using a custom datatype and my script is not firing. Adding the script to my editContent.aspx would be my next attempt. This was the actual script that didn't fire:
We use custom JavaScript for most of the data-types in uComponents - take a look at the source-code if you need any pointers ... or ask mroe questions, happy to help answer them!
My guess if that your JavaScript is trying to access the jQuery object at the wrong stage ... but would need to see more of your code to figure out what the problem is.
Adding logic to the editContent.aspx
UMB 4.7.1
.NET 4.0
WIN SVR 2008 R2 ENT
Umbraco Devs,
Are there best practices one should follow when adding custom Javascript to the editContent.aspx page? It seems as if my simple javascript is not functioning.
$("#myButton").click(function(){
alert("Yes");
});
Why would you want to add javascript to that page? It's part of the Umbraco source and shouldn't be changed. Have you tried adding javascript with a custom datatype?
Jeroen
Yes, so to clarify, I am using a custom datatype and my script is not firing. Adding the script to my editContent.aspx would be my next attempt. This was the actual script that didn't fire:
function togIt()
{
$(document).ready(function () {
$("#btnSubmit").click(function () {
$("#registrationWrapper").toggle();
});
});
}
Kevon,
you should add your js script in your custom datatype code
Cheers,
/Dirk
OK Gentlemen,
It's apparent that I missed something I'll go back and review my code and see where I'm going wrong. I usually am...
Hi Kevon,
We use custom JavaScript for most of the data-types in uComponents - take a look at the source-code if you need any pointers ... or ask mroe questions, happy to help answer them!
My guess if that your JavaScript is trying to access the jQuery object at the wrong stage ... but would need to see more of your code to figure out what the problem is.
Cheers, Lee.
Everything's working now js path was incorrect.
is working on a reply...