HTML CSS/JS Path Error - javascript

I have two directory in a server: Project A and Project B. In my local development server, both projects work normally. In actual live server, everything is normal in Project A, but this happens to Project B.
My HTML:
<link href="mydir/lib/css/css1.css" rel="stylesheet" type="text/css"/>
<link href="mydir/lib/css/css2.css" rel="stylesheet" type="text/css"/>
<link href="mydir/lib/css/css3.css" rel="stylesheet" type="text/css"/>
But instead it echoed:
<link href="mydir/lib,_css,_css1.css+lib,_css,_css2.css,lib,_css,_css3.css" rel="stylesheet" type="text/css"/>
or
<link href="mydir/A.lib,,_css,,_css1.css+lib,,_css,,_css2.css+lib,,_css,,_css3.css" rel="stylesheet" type="text/css"/>
This happened not only for including CSS, but for JS too. My page CSS display seems normal, but my JS sometimes is not working (undefined functions or variables, but they are already in the included JS files). I don't know if the JS error happened because of this.
Directory name doesn't matter, I tried to change them, sometimes it works, sometimes not. Whether the files actually exist or not doesn't matter too, and again in this case, sometimes it works, sometimes not. Tried not to include or run any JS too, not working. Absolute/relative path doesn't matter too.
This is the first time this happens to me, I couldn't pinpoint why. Does anyone know why this happen and how to fix it?

Related

Bootstrap Dialog CSS Causing Issues

I m having a problem with Bootstrap Dialog library designed to assist in modal windows.
I would like to use the library in WHMCS but it seems as though the files I need to include break the template.
As indicated by the examples I included:
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap3-dialog/1.34.9/css/bootstrap-dialog.min.css" rel="stylesheet" type="text/css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap3-dialog/1.34.9/js/bootstrap-dialog.min.js"></script>
But as soon as I do this the template breaks. It throws litterally everything out of place, including the menus and images in WHMCS. But the popup I excecute does show.
If I remove the <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet" type="text/css" /> the template does go back to normal, but then the command that I call to show the dialog does nothing. I cannot see a response in the console, nor do I see anything happen in the browser anymore.
What could be the cause & a possible solution to this issue?
Is there a way to use this library and/or another similar library?
I would love any and all advice in this matter.
Bootstrap Dialog: https://nakupanda.github.io/bootstrap3-dialog/

NetBeans auto import the path of javascript files

I am developing web based software applications which means that the presentation layer is html pages.
Every html page needs to have imported javascript files (sometimes 10 to 15) and lots of css files (sometimes 20 to 30).
I find it really anoying to write the path to each one of them ( Well when you write the path to the first one then you can simply copy and paste it and change only the file name but this is not the case ). Ok... i was talking about that it is really annoying and time consumption.
Here is example:
<link rel="stylesheet" type="text/css" href="../css/styles.css">
<link rel="stylesheet" type="text/css" href="../xxx/yyyy/zzz/a.css">
<link rel="stylesheet" type="text/css" href="../xxx/yyyy/zzz/b.css">
<link rel="stylesheet" type="text/css" href="../xxx/yyyy/zzz/c.css">
<script src="../xxx/a.js"></script>
<script src="../xxx/yyy/zzz/b.js"></script>
<script src="../xxx/yyy/zzz/c.js"></script>
<script src="../xxx/yyy/zzz/d.js"></script>
So lets just ask you the question:
Is there a way (or a plugin) in NetBeans which can help me to drag the file from its location (the project is visualized as a tree) and put it in the html so its path to be automatically inserted in the file?
I know this is an old post but as of recent versions of NetBeans, drag the file from the tree into the document itself, and it will place a tag to the CSS file automatically.
Cheers

Struggling with LESS

I am trying to learn about LESS. After a very quick success on one site, I am now struggling on another while using pretty much the same code:
<link href="css/reset.min.css" rel="stylesheet" />
<link href="css/styles.less" rel="stylesheet/less" type="text/css" />
<script src="js/less-1.3.1.min.js" type="text/javascript"></script>
Should I change anything on the server to make it work?
I get a 404 when trying to access your LESS file: http://belleandvidere.co.uk/dev/styles.less
Please check your path.
At one point or another I ran into an issue with the order of the HTML properties (it shouldn't matter but it did).
I found that <link rel="stylesheet/less" type="text/css" href="styles.less"> would work, while <link href="styles.less" rel="stylesheet/less" type="text/css"> would not.
I'm pretty certain that less.js incorrectly checks for <link> elements. This may or may not still be an issue.
Try invoking the LESS JavaScript file before the LESS CSS Document.
I am assuming this due to the HTML DOM.
With the HTML DOM the HTML is loaded, the CSS is loaded, and then the JavaScript is loaded.
Try to place the script tag about the link tags.
Thanks,
I hope that helps.

How to prevent Browser from Caching

I am doing facebook app development. Something really annoy me is that randomly, when I change my CSS style sheet/ adding in a javascript function. The browser does not reflect the change at all. This is really annoying because I can never see the changes I just made.
For example. I changed my CSS style sheet so img1 is moved from 100px to 50px. But in firfox/chrome, the img never moved a bit.
I added a javascript function a() to one of my script. But the browser's console keeps telling me a() is not defined. I have checked through the codes 10 times and there is no error.
Can someone tell me what is the possible problem here and how to solve it?
I am using my mac as the hosting server btw
Thanks
You can add a timestamp or other unique string to the filename of the files you don't want to be cached, either in the actual filename or as a GET parameter:
<link rel="stylesheet" type="text/css"
href="http://cdn.sstatic.net/stackoverflow/all.css?v=4fd8a9d8937d">
Depending on the server-side language you're using to server your pages, you could do something like:
PHP (using filemtime - which returns the modification time of a file):
<link rel="stylesheet" type="text/css"
href="http://cdn.sstatic.net/stackoverflow/your_css_file.css?v=<?php echo filemtime('/your_css_file.css'); ?>">
Ruby (using File.mtime which returns the modification time of a file):
<link rel="stylesheet" type="text/css"
href="http://cdn.sstatic.net/stackoverflow/your_css_file.css?v=<% print File.new("testfile").mtime.to_time.to_i('/your_css_file.css'); %>">
If you use the file's modification time, your users are only forced to download the file again if it has been modified.
when including your js/css files, include the timestamp as a param, something like this should do it :
<link rel="stylesheet" href="css/screen.css?<?php echo time(); ?>" media="all"
type="text/css" />

jQuery undefined

Getting a weird error on a site I am developing. Even looked back at last couple of sites to make sure there was no differences... and nope, can not see any.
Getting an jQuery undefined error only in IE on the following page http://weesleekit.info/lotus/beta/ it's with regard to the easy slider part on the site, but have used easy slider multiple times before and never ever had an issue.
Can anyone shed some light into this, I am racking my brains and seem to be finding nothing.
Your problem is here:
<link rel="Stylesheet" type="text/css" media="screen" href="css/screen.css" /
><script type="text/javascript" src="js/easySlider1.7.js"></script>
There are several lines in between your / and > that shouldn't be there, and IE isn't including the <script> block that follows it.
I have no idea if this is related, but in the source of that site, before jquery.js is included there is an unclosed:
<link REL="SHORTCUT ICON" HREF="favicon.ico">
(make it: ```)
maybe IE is bugging out and not including jQuery since it is technically inside the <link> element. See if fixing that does anything (i kinda doubt it)
and a comment by #burningstar4 says that there is a link which is missing a closing tag as well:
<link rel="Stylesheet" type="text/css" media="screen" href="css/screen.css" /
should be
<link rel="Stylesheet" type="text/css" media="screen" href="css/screen.css" />

Categories

Resources