Digital experiences for all disciplines
New Landing › How can we help? › Themeforest Theme Support › Dante › Can't Insert Raw HTML / Raw JS
New Landing › How can we help? › Themeforest Theme Support › Dante › Can't Insert Raw HTML / Raw JS
- This topic has 7 replies, 4 voices, and was last updated 10 years by Swift Ideas – Ed.
-
Posted in: Dante
-
February 21, 2014 at 2:00 am #50689
I recently updated to the latest version of the Dante Theme (2.15) and I can’t seem to insert raw JS or HTML using the PageBuilder. Every time I insert Raw HTML/JS, and try to save / update a page, it seems to delete it and the raw HTML / raw JS box shows up empty when it gets refreshed. What’s happening here?
Wordpress Version: 3.8.1
Dante Version: 2.15I’m able to insert raw HTML by using a text block but when I try to include javascript it gives me the following console error:
Uncaught TypeError: Property ‘$’ of object [object Object] is not a function
The JavaScript I’m trying to insert:
<script type=”text/javascript”>
$(document).ready(function() {
$(“.signup-type”).change(function() {
if ( $(“.signup-type”).val() == “Merchant”) {
$(‘#merchant-fields’).show();
} else {
$(‘#merchant-fields’).hide();
}
});
});
</script>February 21, 2014 at 2:11 am #50691OK, I just realized I was inputting jQuery wrong, since wordpress runs jQuery in noconflict mode.
Raw JS Still doesn’t work. Here’s what I tried next in a text block (in the text tab):
<script type="text/javascript"> jQuery(document).ready(function() { jQuery(".signup-type").change(function() { if ( jQuery(".signup-type").val() == "Merchant") { jQuery('#merchant-fields').show(); } else { jQuery('#merchant-fields').hide(); } }); }); </script>
Instead, that turns into:
<script type="text/javascript">// <![CDATA[ jQuery(document).ready(function() { jQuery(".signup-type").change(function() { if ( jQuery(".signup-type").val() == "Merchant") { jQuery('#merchant-fields').show(); } else { jQuery('#merchant-fields').hide(); } }); }); // ]]></script>
What’s going on w/ the Raw JS?
February 21, 2014 at 9:55 pm #50994I am having a similar problem. Our website is at:
When we use the Raw HTML element, no matter how simple the code, it will get corrupted when the page is updated and will show funny characters instead of the text.
This does not happen if we use a “Text Block (Full Width)” and set the editor to “HTML” mode.
You can see the gibberish on a raw html block just under the slider, and a sample “Text Block (Full Width)” at the bottom of the page which works correctly.
Please advise!
P.S. Thanks for fixing the problem with the “Tours” shortcode — it’s working fine now.
February 24, 2014 at 9:19 am #51205Hi,
Have assinged this to Ed, I am sure it will be investigated and fixed for the next update.Best,
TahirFebruary 24, 2014 at 7:31 pm #51368Hey guys,
Apologies for this – it’s been one of those things we’ve been meaning to get fixed for a while. Just spent the last hour or so working on it and think I’ve pretty much got it 100% now. If you drop me an email via: http://themeforest.net/user/swiftideas then I’ll happily send over a fixed build for you.
Thanks,
– Ed
February 24, 2014 at 7:38 pm #51369OK, I’ll drop you an email separately, Ed.
As for everyone else: One thing that worked for me was putting in Raw HTML (not JS) into a text block on the raw text side, and then including the JavaScript in the functions.php of a Dante-Child theme. I created a separate JavaScript file for my custom JS and included it there, so hopefully this provides some folks a temporary solution until an official fix is out.
Thanks,
pavFebruary 24, 2014 at 7:40 pm #51371Thanks for your prompt reply, Ed. We just sent you a message from your user page. Please send the fixed build to the email address specified on that message. Thanks again for your help with this matter.
February 24, 2014 at 10:57 pm #51393Replied to both of you 🙂
– Ed
-
Posted in: Dante
You must be logged in and have valid license to reply to this topic.