关于在.php中使用JavaScript [英] About using JavaScript in .php

查看:151
本文介绍了关于在.php中使用JavaScript的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我真的只是一个HTML / CSS的人。

I'm really actually just a html/css guy.

我想在我的页面上插入预订表单,但我有一个自定义链接用于添加形成。链接只包含基本脚本,我被告知只需将其复制到我的html文件中。问题是我必须将它添加到一个.php文件,当我做和重新加载我的网页它显示一个空白。

I want to insert a booking form on to my page but i got a custom link for adding the form. The link consist of just basic script and I'm told to just copy it onto my html file. The problem is i have to add it to a .php file and when i do and reload my page it shows a blank.

我的.php文件中有一个基本的div,一个用于调用图像的div,然后是我的Script。你能告诉我我的问题在哪里吗?

I have a basic div in my .php file and a div for calling an image, then my Script. Can you tell me where my problem is?

 <div id="dine_oliver_cattermole" class="content_holder border"></div>
 <div id="dine_oliver_cattermole" class="content_holder border">
 <table class="chef_holder" width="100%">
    <tr>
        <td width="30%" align="left" class="dine_chef_photo"><img src="/wp-content/.." width="290" height="440" /></td>
        <td width="40%" align="center" class="dine_chef_text">
            <h2>The Tasting Room’s Guiding Principles:</h2>
            <h3>-</h3>
            <h3>Please allow 3½ hours for this menu.</h3><br />
            <p>We do not have a dress code, you dress for the experience you.</p> 
            <p>Only open for dinner Tuesday</p>
        </td>
    </tr>
 </table>
 </div>

<!-- Start Bookatable Code -->
 <script type="text/javascript" src="http://ajax...."></script>
 <script type="text/javascript" src="https://bda...."></script>
<a id="target" href="#">Book Online</a>
<script type="text/javascript">
$(function () { 
    $("#target").lbuiDirect({
       connectionid  :  "LITH",
       popupWindow  :  {enabled  :  true}
    });
});
</script>
<!-- End Bookatable Code -->

还有他的代码可以使用,但是显示为空。

Also got his code to use, but displaying blank.

 <!-- Start Bookatable Code -->
    <script type="text/javascript" src="https://bda....."></script>
    <script type="text/javascript">
         LBDirect_Embed({
         connectionid  :  "ZA-RES-THELIVINGROOMATLEQUARTIERFRANCAIS_283714:67970"
     });
    </script>
<!-- End Bookatable Code 

 <div id="dine_oliver_cattermole" class="content_holder border"></div>
 <div id="dine_oliver_cattermole" class="content_holder border">
   <table class="chef_holder" width="100%">
    <tr>
     <td width="30%" align="left" class="dine_chef_photo"><img src="/wp-content/.." width="290" height="440" /></td>
     <td width="40%" align="center" class="dine_chef_text">
        <h2>The Tasting Room’s Guiding Principles:</h2>
        <h3>-</h3>
        <h3>Please allow 3½ hours for this menu.</h3><br />
        <p>We do not have a dress code, you dress for the experience you.</p> 
        <p>Only open for dinner Tuesday</p>
    </td>
</tr>




推荐答案

<@> @PalDev @Adder @RiggsFolly非常感谢,最后我提到它对于html文件来说看起来很好,所以我只是用html文件将它应用到这个目录和我的页面之一挂钩我使用iframe调用了html。它成功地调用了脚本。

@PalDev @Adder @RiggsFolly Thanks so much, at the end i as you mentioned it looks fine for a html file so i just used the html file coping it into this directory and on one of my page hooks I called the html using an iframe. It called the script succefully.

所以我的.html文件包含脚本:

so my .html file helds the script:

 <!-- Start Bookatable Code -->
  <script type="text/javascript" src="https://bda.book..."></script>
  <script type="text/javascript">
  LBDirect_Embed({
  connectionid  :  "ZA-RES-THELIVINGROOMATLEQUARTIERFRANCAIS_283714:67970"
  });
  </script>
 <!-- End Bookatable Code -->

然后我的page.php钩住下面的页面part_page-info.php,其中包含调用我的iframe。 html文件:

Then my page.php hooks the following page part_page-info.php which contains the iframe calling my .html file:

    <td width="30%" align="right">
        <iframe style="display: block; width: 100%; height: 404px;" src="/wp-content/theme/leeu/content/leeu-test/tasting-room/test.html"></iframe>
    </td>

然后显示我正在查找的JavaScript(即时提及我认为我没有工作,因为所有其他页面即使没有提到这也被称为和从page.php挂钩JavaScript中断脚本即时通讯尝试使用)。这是我的简单解决方案。

This then displays the JavaScript i was looking for.(im just mentioning i think i did not work because all the other pages im not mentioning thats also been called and hooked from page.php has JavaScript interrupting the Script im trying to use).This was my easy solution around it.

这篇关于关于在.php中使用JavaScript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆