I designed a map using imapsbuilder. it gave me a javascript which can be used inside my code to view the map but the problem is its not being viewed properly in php. Someone please help me.
<script type="text/javascript" src="http://g3.imapbuilder.net/_api/?s=66e09d9be7bef2be0a12285bac364c88&m=22671" charset="utf-8"></script>
<script type="text/javascript" src="http://g3.imapbuilder.net/_api/?s=d0b187c9f3cae7f52b14798f2ac89be0&m=22674" charset="utf-8"></script>
I put your code into a php file outside the tag and seems it works fine.
So you can try to close your php tag, put the script code and then open the php tag again.
Related
I setup bootstrap files in public folder. Routes are as below:
<link rel="stylesheet" href="{{url('assets/css/bootstrap.min.css')}}">
<script type="text/javascript" src="{{url('assets/js/bootstrap.min.js')}}"></script>
<script type="text/javascript" src="{{url('assets/js/jquery.min.js')}}"></script>
<script type="text/javascript" src="{{url('assets/js/tether.min.js')}}"></script>
no problem with this. I can see connection to files when I check the source code. and also bootstrap fonts are active but, when I try to copy some examples from bootstrap website. It doesn't display properly. For example I copied navigation bar to my main.blade But it doesn't show up.
What is causing this? Any idea?
It s big screen but showing responsive hamburger icon?
You should add jquery before bootstrap min js file
<link rel="stylesheet" href="{{url('assets/css/bootstrap.min.css')}}">
<script type="text/javascript" src="{{url('assets/js/jquery.min.js')}}"></script>
<script type="text/javascript" src="{{url('assets/js/tether.min.js')}}"></script>
<script type="text/javascript" src="{{url('assets/js/bootstrap.min.js')}}"></script>
The order in which you add javascript in HTML page is important. In this case since bootstrap.min.js uses jquery.min.js jquery must be added first. So when bootstrap loads and looks for jquery it finds it.
But if one script does not depend on another then you can add them in any order.
So add jquery.min.js first then anything that uses jquery(like bootstrap) after it.
I have a php website that is live on webserver,
From my understanding I see that I cannot make a index.php page as the home page of my app. As an alternative I have made an index.html page and put a link in it that points to my php page.
I am using phonegap build to compile the app
The error that I am getting is that the link is opening in the default web browser of my phone instead of within the app itself.
In the html page title I have added
<script src="phonegap.js"></script>
<script type="text/javascript" charset="utf-8" src="cordova.js"></script>
In the config.xml file I have added
<feature name="InAppBrowser">
<param name="android-package" value="org.apache.cordova.inappbrowser.InAppBrowser" />
</feature>
<access origin="http://mydomain" subdomains="true"/>
I have tried www.appsgeyser.com and my website opens up within the app itself in the android apk that I made over there ( in fact while making the app i only provided my website landing php page and it worked perfectly , so there has to be a way to use php in phonegap) , but they don't have an option to build in ios and I would like to use phonegap build instead.
What am i doing wrong?
Thanks,
Depending on how responsive your index.php file is, an easy fix would be to place an iframe in your html.index file.
So something like this:
<body>
<iframe style="width:100%; height:100%;border:none"
src="http://***path-to-your-php-file***.php" />
<script type="text/javascript" src="cordova.js"></script>
<script type="text/javascript" src="js/index.js"></script>
<script type="text/javascript">
app.initialize();
</script>
</body>
I have been trying to get this tooltip code to initialize on a page and I cannot get the jQuery to connect properly.
We have PHP running on Ubuntu and we are using Silverstripe. I cannot get the following script to work, no matter where or what file I add it to. I have even tried calling it in from a separate file and it also did not initialize.
How would I add this code to a PHP or SS file? (Silverstripe CMS file)
$(function () {
$('[data-toggle="tooltip"]').tooltip()
})
<button type=\"button\" class=\"btn btn-default help-tool\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"Below you will find state-by-state breakdowns in Federal, State, and where available Local categories.
Explore the data by clicking the map or by clicking the magnifying lens in the table view.\"><i class=\"fa fa-info-circle fa-fw\"></i></button>
This is generally an issue involving the order in which your scripts are called.
As I'm sure you know, you need to call JQuery before Bootstrap, which it seems like you are doing. Your tooltip code, which is in a different file, is most likely being called before your JQuery and Bootstrap have a chance to load. You can test this by copying your JQuery and Bootstrap script calls into your separate file right before the tooltip script call.
If your script calls are at the bottom of your body tag, and part of the page is being dynamically loaded, you can try calling JQuery and Bootstrap in your head tag instead after your CSS:
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" src="bootstrap.css" />
<link rel="stylesheet" type="text/css" src="main.css" />
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="bootstrap.js"></script>
</head>
<body>
<!--
Your separate file code that
includes tooltip
-->
<!-- Before
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="bootstrap.js"></script>
-->
</body>
</html>
There are two causes that come to mind here. First, it's possible that the $ is getting interpreted by SS's template parser as a variable expression. I would expect you would be getting an error if that is the case. Second, as Sumit Kukreja indicated it's likely that jQuery and Bootstrap are being injected at the bottom of your template and this code is getting executed before those are loaded.
Option 1: To verify if this is happening you could add the following code to Page_Controller::init() or mysite/_config.php:
Requirements::set_write_js_to_body(false);
Which will cause all required javascript to be added in the <head> tag. Not a good idea for production but could help diagnose your problem.
Option 2: You can include that javascript from your controller using Requirements::customScript.
Option 3: Wrap your js snippet in a non-jquery domready listener like so:
document.addEventListener("DOMContentLoaded", function(event) {
$('[data-toggle="tooltip"]').tooltip()
});
I have big problem here and it seems i dont know that much jQuery so i need help. If someone know this i will be grateful.
I copy everything from their folders and i want to use skin thumbnail 07. Everything was ok when my page stays in ''skin'' folder, but when i take it out, JSSOR showing me just one picture. I cant figure it out where i need to change code...that i dont need to put every single page in ''skin'' folder.
You can check my working code here
And not good one here
Only difference is different place of .php file
Thank you
js file reference path is incorrect.
please replace
<script type="text/javascript" src="../js/jssor.core.js"></script>
<script type="text/javascript" src="../js/jssor.utils.js"></script>
<script type="text/javascript" src="../js/jssor.slider.js"></script>
with
<script type="text/javascript" src="js/jssor.core.js"></script>
<script type="text/javascript" src="js/jssor.utils.js"></script>
<script type="text/javascript" src="js/jssor.slider.js"></script>
I have a HTML file styled with external CSS. It works fine but when I change the HTML file to PHP (with the same code), the CSS seems not working with my PHP file.
The files are almost exactly identical, and they look like this:
<html>
<head>
<link href="css/style.css" media="all" rel="stylesheet" type="text/css"/>
<script src="scripts/jquery-1.3.2.min.js" type="text/javascript"></script>
<script src="scripts/jqueryactions.js" type="text/javascript"></script>
<script src="scripts/mousetrail.js" type="text/javascript"></script>
</head>
<body>
<!-- content here -->
</body>
</html>
The full code of the HTML and of the CSS, and a diff between the HTML-version and the PHP-version can be found on pastebin:
Full HTML
Full CSS
diff between HTML and PHP
As you can see, the HTML and PHP code are the same. But they give different output. Please help me figure this out.
the html and php code are thesame but they give different output
This isn't entirely true. A PHP will be processed by the PHP interpreter when a HTML won't (by standard/traditional setups).
If you have PHP code in your file, it could have a syntax error which might cause things to not load properly.
With that said, the only PHP code I see is:
<?include('try.php');?>
I'm guessing this could be the problem. Try these steps in troubleshooting:
Change your code to PHP 5 compliance by adding "php" after the first '?' along with an extra space between <?php include... like so:
<?php include('try.php'); ?>
Refresh the page to see if that worked. If it did, it's a syntax issue with your version of PHP.
Comment out the PHP code to see if the PHP page will run as straight HTML.
<?php //include('try.php'); ?>
If this did the trick, there's likely an issue in the try.php file that's causing the issue.
Try those troubleshooting steps to see if that helps. And, as Alex FI points out, add a DocType to your HTML.
I hope that helps!