grails: Href and Src to Subfolder not working - javascript

i have the files inside the folder lib\Responsive
How to link this inside the GSP file?
i have used the following code but its not working:
<script type="text/javascript" src="/lib/Responsive/Responsive.min.js"></script>
<link rel="stylesheet" href="/css/tablestyle.css"/>
i hope it should be from static folder how to refer ?

<link rel="stylesheet" href="${resource(dir:'css',file:'tablestyle.css')}" />
If css file under wep-app/css/tablestyle.css
.

Related

Problem with the basel url in php directory

I have a problem
i have a index.php in that index
i link a
includes/meta.php
file. in that file i have style .css files and jquery .js files.
i have also
index.php
and a about/index.php
when i link the css from the include/meta.php to index.php the link works,
<link href="vendor/css/style-front.css" type="text/css" rel="stylesheet" />
but does not work in this about/index.php directory
Why?
Someone here for a solution to fix this ?
i have tried this
<link href="http://localhost:8888/vendor/css/style-front.css" type="text/css" rel="stylesheet" />
this works with the localhost:8888
but how fix this with like
<?php
print "<link href='{$base_url}vendor/css/style-front.css'/>";?>
Anyone here ?

Script and css linking

when my index at here
the script url was
<link rel="stylesheet" type="text/css" href="../jquery.fullPage.css" />
<script type="text/javascript" src="../jquery.fullPage.js"></script>
when i move the index file to front folder > untitled 3
which is here
and the url change to
<link rel="stylesheet" type="text/css" href="jquery.fullPage.css" />
<script type="text/javascript" src="jquery.fullPage.js"></script>
but it dint work.
Even the link use browse and select the script file and url given by the system
help~
is that any setting need to change

how to call css and js files in webview?

I have one local html page in my android app.
in html page i call css and js files but when i run app , only context loaded and css and js don't load
I import css and js folders to android_assets/images/css nad android_assets/images/js
and i call css and js in html page like this:
<link href="./android_asset/images/css/bootstrap.min.css" rel="stylesheet" />
<link href="./android_asset/images/css/bootstrap-responsive.min.css" rel="stylesheet" />
<link href="./android_asset/images/css/touchnswipe.min.css" rel="stylesheet" />
<link href="./android_asset/images/css/responsive.css" rel="stylesheet" />
<script src="./android_asset/images/js/jquery-1.10.0.min.js" type="text/javascript"></script>
<script src="./android_asset/images/js/bootstrap.min.js" type="text/javascript"></script>
<script src="./android_asset/images/js/modernizr.custom.js" type="text/javascript"></script>
<script src="./android_asset/images/js/jquery.mousewheel.min.js"></script>
<script src="./android_asset/images/js/jquery.hammer.min.js" type="text/javascript"></script>
<script src="./android_asset/images/js/TweenMax.min.js" type="text/javascript"></script>
<script src="./android_asset/images/js/responsive_example.min.js" type="text/javascript"></script>
And in Sites.java onCreate section i write this code:
WebView wbSites =(WebView)findViewById(R.id.wbSites);
// wbSites.setWebChromeClient(new WebChromeClient());
// wbSites.setWebViewClient(new WebViewClient());
wbSites.getSettings().setJavaScriptEnabled(true);
wbSites.loadUrl("file:///android_asset/images/sites.html");
Tip: htmlpage named sites.html and pasted in android_asset/images path
but still don't load js and css files.
pls help me
Have you tried including the file:// prefixes to all the resources you want to load?
i solve it
i most write address like this
<script src="./js/modernizr.custom.js" type="text/javascript"></script>
. Refers to local root => /android_asset/images/

jsp dont load css and scripts after deploy

I am trying to deploy a java jsp application, but the view not charge .css and .js files, as I can fix this?
the file structure is as follows:
-Project
-META-INF
-WEB_INF
-resources
-CSS
-scripts
-administracion
-control
-inicio
Your could add lines given below:
<script type="text/javascript" src="resources/scripts/your_js_file.js"></script>
<link rel="stylesheet" type="text/css" href="resources/CSS/style.css" />
Add this line in your jsp
<script type="text/javascript" src="scripts/your_js_file.js"></script>
<link rel="stylesheet" type="text/css" href="css/style.css" />
scripts and css are folders outsideWEB-INF and contains .js files and .css files respectively
logically he called .css and .js files from the JSP.
when I'm editing the project work perfectly, but do not load the deployment
<link href="../resources/css/bootstrap.css" rel="stylesheet" type="text/css"/>
<link href="../resources/css/colors.css" rel="stylesheet" type="text/css"/>
<script src="../resources/scripts/jquery.js" type="text/javascript"></script>
<script src="../resources/scripts/bootstrap.js" type="text/javascript"></script>

Where do I put the JQUERY UI theme folder?

This is my code. It turns my text box into a date picker.
<script type="text/javascript" src="{{MEDIA_URL}}template/js/jquery-1.4.1.min.js"></script>
<script type="text/javascript" src="{{MEDIA_URL}}template/js/jquery-ui-all.min.js"></script>
<script type="text/javascript">
$(function() {
$("#start_date").datepicker();
$("#end_date").datepicker();
});
</script>
Where do I put the ui-lightness folder? It contains the images and js of the theme. Right now, the images and CSS are blank on my page.
You can place it anywhere you like, but you need to link the the CSS file to have it affect your page.
You need the default CSS
<link type="text/css" rel="stylesheet" href="Content/jquery-ui.css" %>" />
And the control specific files as well, for instance the dialog would need.
<link type="text/css" rel="stylesheet" href="Content/ui.dialog.css" %>" />

Categories