Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search
  • 0
Gypsychick

Broke my site by adding javascript

Question

Hello.  First time here on the forum. 

I looked through plenty of previous threads, but didn't find the answer to my specific challenge.

I built a site recently, and all was fine until today, when I added custom code to have a booking window open within the same frame.  It worked fine on the testing page,  but as soon as I added it to the other pages (confirmed clean/accurate copy and paste), it stopped working AND now I can no long add links within text fields. 

I've used the required <style></style>, and have tested by html in a w3schools.com test window.

Here is a link to the test page:  https://trout-lilac-h8f3.squarespace.com/home2.  The navigation works, so other pages can be visited.

Can anyone see what I've missed or done wrong?

Thanks, in advance. 

Share this post


Link to post

3 answers to this question

Recommended Posts

  • 0

Thanks for your interest in helping, tuanphan.

 

<style><script>
function myFunction() {
  var myWindow = window.open("https://adventurecharters.zaui.net/modules/webBooking/index.php?id=1&action=Details", "", "width=800,height=600");
}
</script>
  
</style>

<style>
.buttonACICBS {
  background-color: #F7C413;
  border: none;
  color: black;
  padding: 25px 65px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 26px;
  font-weight: bold;
  margin: 4px 0px;
  cursor: pointer;
}
</style>
<div align="center" >
  
<button class="buttonACICBS" onclick="myFunction()">BOOK NOW</button>
</div>

Share this post


Link to post
  • 0
<script>
function myFunction() {
  var myWindow = window.open("https://adventurecharters.zaui.net/modules/webBooking/index.php?id=1&action=Details", "", "width=800,height=600");
}
</script>
<style>
.buttonACICBS {
  background-color: #F7C413;
  border: none;
  color: black;
  padding: 25px 65px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 26px;
  font-weight: bold;
  margin: 4px 0px;
  cursor: pointer;
}
</style>
<div align="center" >
<button class="buttonACICBS" onclick="myFunction()">BOOK NOW</button>
</div>

With style & script, you can insert to Header Code Injection, however, with <div>...</div> you can't insert to Header. Use Footer Code Injection or Code Block.


You can send your question to my email to get faster answer.

How to Setup Password & Share URL  Squarespace Customer Care

I'm overloading. Will reply all questions this month.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment


×
×
  • Create New...