Мой код открывает новую пустую вкладку, но только при использовании на Сайтах Google - PullRequest
0 голосов
/ 03 января 2019

Вот код.Имейте в виду, что проблема возникает только при использовании внутри поля HTML на Сайтах Google.Он отлично работает в IE и Chrome при сохранении в файл HTML.Насколько я понимаю, я не могу понять, почему в Сайтах Google открывается новая вкладка без данных.Код все еще работает, когда вы закрываете дополнительную вкладку.

<!DOCTYPE html>
<?php 
session_start();
print "
<html>
</head>
<body>
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
#body {
  display:none;
  width: 100%;
  padding: 5px 0;
  text-align: left;
  background-color: lightblue;
  margin-top: 5px;}
</style>
</head>
<body>
<font size=+5><b>Why would we make a refund and what is the process?</b></font><br>
<div id="body1"><br><br>
  <div>
  <a href='#' class='articleTitle'><font size="+1"><b>The first thing is the circumstances Under which we would make a refund. There are 2 reasons:</b></font></a>
  <div class='showArticle'>
    <p>1. The first reason for a refund would be an Ebay job that we are unable to complete for whatever reason.<br>
     2. The other reason for a refund would be as resolution of a warranty.
  </div>
  </div>
<div id="body2">
  <div>
  <a href='#' class='articleTitle'><font size="+1"><b>How do we process a refund?</b></font></a>
  <div class='showArticle'>
    <p>1. To process a refund for an Ebay job, follow <a href="https://docs.google.com/a/helpscore.com/viewer?a=v&pid=sites&srcid=aGVscHNjb3JlLmNvbXxraG9hdGVzdHxneDo1NTgyZTA4OTk0YzM3MzU0"><b>instructions</b></a> to be sure all steps are being followed correctly, then send an email to have the refund processed.<br>
    2. In the case of a refund as part of the <a href="https://docs.google.com/a/helpscore.com/viewer?a=v&pid=sites&srcid=aGVscHNjb3JlLmNvbXxraG9hdGVzdHxneDozOWEyZWMwZjBjYzVlYzg5"><b>Warranty Process</b></a>, you must have the customer's agreement and forward that to the refund email address.<br><br>
  </div>
  </div>
<div id="body3">
  <div>
  <a href='#' class='articleTitle'><font size="+1"><b>What is the refund email address and email content?</b></font></a>
  <div class='showArticle'>
    <p>When requesting a refund, please forward the customer's refund acceptance and change the subject to: <b>"Please refund customer $"</b><br>
  Please be sure to use the correct <a href="https://docs.google.com/a/helpscore.com/viewer?a=v&pid=sites&srcid=aGVscHNjb3JlLmNvbXxraG9hdGVzdHxneDo1ZThiZjdkNWZiZGIwOWZl"><b>Template</b></a>. You will have to download the file to access it correctly.<br>
  Here is the note to leave after you have sent the refund request: Refund Request sent<br>
  The email address to send the request to is: PSrefunds@porch.com
  </div>
  </div>
<script src='https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js' type='text/javascript'></script>
<script type='text/javascript'>
$(document).ready(function(){

$('.showArticle').hide();
$('.articleTitle').show();

$('.showComments').hide();
$('.commentTitle').show();

$('.articleTitle').click(function(){
$(this).next('.showArticle').slideToggle();
});

$('.commentTitle').click(function(){
$(this).next('.showComments').slideToggle();

});
});
</script>
</body>
</html>

1 Ответ

0 голосов
/ 04 января 2019

Вы можете исправить это, добавив event.preventDefault ().Нравится:

$('.articleTitle').click(function(e){
$(this).next('.showArticle').slideToggle();
e.preventDefault();
});

$('.commentTitle').click(function(e){
$(this).next('.showComments').slideToggle();
e.preventDefault();
});
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...