We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

How to add custom javascrip to a new page | Forum

Kevin
Kevin Apr 4 '17
Created a new page (visible only to members), and would like to paste custom javascript code into the body.  Editing with manage page does not keep the code.


I can not put it in the custom tail section or it would apply to all pages.


Is there a way to to add the javascript to only a specific page?


Thanks!


Code would be similar to:

<script type="text/javascript" language="javascript" src="http://www.xyz.com/widget-585678?target=_top&mouseover=Y"></script>

The Forum post is edited by Kevin Apr 4 '17
Attachments:
  PageContent.JPG (22Kb)
Kevin
Kevin Apr 5 '17
Well Found the following, at http://www.wikihow.com/...r-Website-Using-HTML


<html><head><script language="javascript">alert("Hi there, and welcome.") </script></head><body></body></html>

The above works, but when you go back to edit the html, it is empty. Seems like it must be a setting in Oxwall relating to custom html code...

Scam Detector
Scam Detector Apr 5 '17
Disable the plugin CKEditor and try again.
Kevin
Kevin Apr 5 '17
Have tried that. Disabled both front and rear editor. Still a no go.
The Forum post is edited by Kevin Apr 5 '17
Scam Detector
Scam Detector Apr 5 '17
Tested on a fresh install, it works. I can add the code and edit the code. If it is not the ckeditor, my best guess is it may be a conflict with another plugin.
Kevin
Kevin Apr 6 '17
Ok thanks- will try to identify what plugin has conflict.
Kevin
Kevin Apr 17 '17
Finally had time to go back and test. After disabling the plugin CKEditor the following test adding javascrip to page content works:

===test ======
<html><head><script language="javascript">alert("Hi there, and welcome.")</script></head><body></body></html>

=========== 

However I am trying to incorporate some affiliate code in the Page Content like the following:

<html><head>

<script type="text/javascript" language="javascript" src="http://www.lduhtrp.net/...lank&mouseover=Y"></script>

</head><body></body></html>


The code is able to be saved now, but content does NOT show up on the new test page :(

================== 


Any ideas?

The Forum post is edited by Kevin Apr 17 '17
Kevin
Kevin Apr 28 '17
The code works in a html test site: http://htmledit.squarefree.com/


What setting in Oxwall would be stopping the display?


Is it a .htaccess setting issue:

https://developers.oxwall.com/forum/topic/14889

The Forum post is edited by Kevin Apr 28 '17
Emily Cooper
Emily Cooper Sep 8 '23

To incorporate custom JavaScript into a new webpage, first create an HTML file for the page. Within the HTML file, insert a <script> element in either the <body> or <head> sections. Then, write your desired JavaScript code within the <script> tags. Save the HTML file and link it to your website to ensure the JavaScript runs when the page loads. I gained this knowledge when I Hire Reactjs Developers from India for my project.

Michael Wilson
Michael Wilson Sep 8 '23
iWebServices is one of the fastest-growing web app development companies , who can covert your ideas to reality As today, for development services, we need a strong and dedicated team who can bring excellent results to a given time. We have a team that collaborates effectively, bringing together different perspectives, ideas, and expertise. If you want to hire javascript developers for your next project, we will be glad to help.
Nikhil Carmatec
Nikhil Carmatec Oct 13 '23
When you hire Java developersHire JavaScript developersfrom staffing agencies, you're getting professionals who stay up-to-date with the latest industry trends, ensuring your projects are developed using the most cutting-edge technologies and best practices.