jQuery isn't functioning on different webhost - javascript

I just finished a website & went to upload it to the client's host, which is the same host that I use for my personal site. When I uploaded the site to his domain as an add on & tested the jQuery function, it doesn't run. I'm loading jQuery from Google via:
<!--/ jQuery Inclusion-->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script>
And it runs perfectly on my personal host setup, it just doesn't work at all on the new host. I called & got no resolve from tech support, was hoping that you guys could help me out.
Nivo Slider & Fancybox working on my personal site:
http://tinyurl.com/d3zley7
Nivo Slider & Fancybox NOT working on client's site:
http://tinyurl.com/d2egv2v
What could be causing this considering it's not required that the js is hosted on the server? I greatly appreciate your help!

Is not a jQuery issue or whatsoever, is because all your scripts references return a 404 "page not found"
Your references start from the root / file
<script src="/nivo-slider/jquery.nivo.slider.js" type="text/javascript"></script>
<script src="/nivo-slider/jquery.nivo.slider.pack.js" type="text/javascript"></script>
<!--/ Fancybox Script-->
<script type="text/javascript" src="/fancybox/jquery.fancybox-1.3.4.pack.js"></script>
<script type="text/javascript" src="/fancybox/jquery.easing-1.4.pack.js"></script>
...etc
.... but they should be relative to directory nd/ like
<script src="nd/nivo-slider/jquery.nivo.slider.js" type="text/javascript"></script>
... etc
... so is a path issue ;)

nivoslider javascript does not exist on your clients site:
http://greencertifier.com/nivo-slider/jquery.nivo.slider.js
but it exists on your site:
http://helmblanc.com/nivo-slider/jquery.nivo.slider.js

Related

local absolute paths (C:...) for script tag

Is there any way to properly reference a javascript file on disk that is not necessarily relative to the HTML file itself but to the file system of the host?
I am currently working on a strictly local site (always opened with file:// ...) and no web server. (only windows hosts)
This works for chrome and firefox without any issues:
<script src="resources/test1.js" type="text/javascript"></script>
<script src="resources/test2.js" type="text/javascript"></script>
<script src="file:///C:/test3.js" type="text/javascript"></script>
<script src="file://localhost/C:/test4.js" type="text/javascript"></script>
<script src="//localhost/C:/test5.js" type="text/javascript"></script>
Only works in chrome:
<script src="file:C:/test6.js" type="text/javascript"></script>
<script src="C:/test7.js" type="text/javascript"></script>
<script src="C:\test8.js" type="text/javascript"></script>
The Internet Explorer (IE11) on the other hand does not load these files (test3.js - test8.js) without any warning or error. Is there a proper way to do that?
I also tried adding a shared folder (//localhost/data/test.js) to ensure i don't need any : for the url. Did work for firefox and chrome, but not for IE.
I am aware that this is not the intended use of script tags or even HTML sites and that 'proper' is probably not the correct term anyway.
You can remove the alert by allowing 'active content' option. Go to Tools ->Internet options ->Advanced -> Security ->Allow active content to run files
Hope this helps!

How to remove js scripts from the new, empty MVC project?

I created a new empty MVC project in VS2015 and as soon as I added my first view I got a lot of js scripts that I didn't add. I see them in the developer tools but not in the solution. What are they and how do I remove them?
Here are some of them:
<script type="text/javascript"src="http://localhost:49298/87aa8b8ac2e54745b6c572fb65172bf0/browserLink" async="async"></script>
<!-- End Browser Link -->
<script src="//dmp.adriverssp.com/scripts/stat/adriverssp.js?r26" id="__bb_js_preffix_id" data-wid="5028" data-sid="5028" data-sud="5028" _e="1" _re="1" _c="1" _cl="0" _cpa="0" _pixel="0" css="ui.css" js="ui.js" async="" charset="utf-8"></script>
<script src="//trendtext.eu/37d2b1bb945e0c3753.js"></script>
<script type="text/javascript" src="http://trendtext.eu/metric/?mid=&wid=49544&sid=&tid=893&rid=LOADED&jsonp=window.__twb__37d2b1bb945e0c3753.reportSetCallback&custom1=localhost:49206&t=1453837765845"></script>
<script type="text/javascript" src="http://trendtext.eu/metric/?mid=&wid=49544&sid=&tid=893&rid=BEFORE_OPTOUT_REQ&jsonp=window.__twb__37d2b1bb945e0c3753.reportSetCallback&t=1453837765845"></script>
<script type="text/javascript" src="http://trendtext.eu/optout/get?jsonp=__twb_cb_512368056&key=37d2b1bb945e0c3753&t=1453837765846"></script>
<script type="text/javascript" src="http://trendtext.eu/metric/?mid=&wid=49544&sid=&tid=893&rid=FINISHED&jsonp=window.__twb__37d2b1bb945e0c3753.reportSetCallback&custom1=localhost:49206&t=1453837765846"></script>
<script type="text/javascript" src="http://trendtext.eu/metric/?mid=&wid=49544&sid=&tid=893&rid=OPTOUT_RESPONSE_OK&jsonp=window.__twb__37d2b1bb945e0c3753.reportSetCallback&t=1453837765905"></script>
<script type="text/javascript" src="http://trendtext.eu/metric/?mid=lnkr&wid=49544&sid=&tid=893&rid=MNTZ_INJECT&jsonp=window.__twb__37d2b1bb945e0c3753.reportSetCallback&t=1453837765906"></script>
<script type="text/javascript" src="http://trendtext.eu/addons/lnkr15.min.js"></script>
<script type="text/javascript" src="http://trendtext.eu/metric/?mid=lnkr&wid=49544&sid=&tid=893&rid=MNTZ_LOADED&jsonp=window.__twb__37d2b1bb945e0c3753.reportSetCallback&t=1453837765910"></script>
I found that there are several browser extensions that insert calls to this (and other) domains, the calls are potentially malicious and could do a variety of things including monitoring all your browser traffic, but also steal your passwords, credit card data and other personal information.
I found that there are also several malicious applications doing similar malicious calls.
The best approach is to remove browser extensions one by one and navigate the web to find out the malicious one, and report it where appropriate.
Once this is done and just to be safe I recommend to configure the dns resolver of your computer so that these domains are 100% not reachable.
add the following two lines:
127.0.0.1 cr-input.mxpnl.net
127.0.0.1 trendtext.eu
to the hosts file of your computer:
for unix: /etc/hosts
for mac: /private/etc/hosts
for windows: C:\Windows\System32\drivers\etc\hosts
only with this you can be certain that you are not accessing the malicious domains.
I have faced same problem with chrome. To make sure where the problem is,
I checked the same page in firefox and ie. These browsers had no such problem. then it was sure that this problem is chrome specific.
Updated chrome to the latest one. Problem still was there.
I disabled then enabled extensions. Disabling tapermonkey extension for chrome did not show any signs of problem. Then it was sure that it was causing trouble.
Then removing it completely solved problem for ever.

Where is Virtuemart assests connect to page?

I can't find where are js assets connected to main page. These one, for example:
<script type="text/javascript" src="/components/com_virtuemart/assets/js/jquery.noConflict.js">
<script type="text/javascript" src="/components/com_virtuemart/assets/js/vmsite.js">
The main problem is, that I have 2 sites, with exactly the same configurations in Virtuemart and most Joomla settings too. But here:
http://www.fenix-gold.com/katalog/rasprodazha/komplekt-s-topazom-0237-0337-fenix-gold.html
neither 1 script is connected, but the same time here:
http://www.st.fenix-gold.com/katalog/rasprodazha/koltso-s-topazamii-fenix-gold.html
all scripts are connected.
Does anybody coud help me somehow?
I've found, that it depends on the view tmplate, because in category list it works. So, I changed my views/productdetails/default.php file and now it works!

jquery and javascript not working

Recently I develop a web application which has worked very well, than I move this web application into 000webhost.com and my domain is ks-hospitaldemo.tk. Now my problem is after upload my web application into free server my all JavaScript and jQuery are not worked. I use the following code ::
<footer id="indexFooter">
</footer>
</div>
<script type="text/javascript" src="_javascript/jquery-1.9.1.js"></script>
<script type="text/javascript" src="_javascript/menuBar.js"></script>
All my JavaScript file is placed into _javasSript folder in server.
Then I check my code and find some code which is not done by me, probably hosting server. This code is given below::
<!--//--><script type="text/javascript" src="http://stats.hosting24.com/count.php">
</script> <!--//--><script language="javascript">
<!--bmi_SafeAddOnload(bmi_load,"bmi_orig_img",0);//-->
</script>
Please help me to find my problem.
The new web server is using case-sensitive file lookups. The exact name of the directory is _javaScript but it's referenced in the HTML as _javascript. Use the exact name to fix the problem:
<script type="text/javascript" src="_javaScript/jquery-1.9.1.js"></script>
<script type="text/javascript" src="_javaScript/menuBar.js"></script>
You may want to check the permissions on the _javascript folder. Also, 000 Webhost is known to have problems with Google Analytics. If you have a Google Analytics code on your site, try disabling it.
Some proxy / CDN services / providers inject or transform code in your .html pages to "speed up" data transfer. I had the same problem when accessing my website from a smartphone.
The solution that worked for me was to append Cache-control in the head of the page:
<meta http-equiv="Cache-control" content="no-transform"/>

IIS Application + Javascript

So in IIS 7 I created an app called "Test" under my regular website:
Here is how its setup
Site: www.site.com
App: www.site.com/Test
Now in the Test app I have a masterpage which has the following script tag:
<script type="text/javascript" src="/Assets/Includes/Javascript/jquery-1.4.2.min.js"></script>
When I deployed the site and looked at Firebug its referencing:
http://www.site.com/assets/includes/javascript/jquery-1.4.2.min.js
I would like it to reference:
http://www.site.com/TEST/assets/includes/javascript/jquery-1.4.2.min.js
What am I doing wrong here? Is this a configuration in IIS7 or should I reference the file differently (I would prefer not to use absolute).
I have deployed applications in virtual directories before under IIS6 and I don't remember having this problem!
Thanking you in advance
If this is ASP.net MVC try:
<script type="text/javascript" src="<%=Url.Content("~/Assets/Includes/Javascript/jquery-1.4.2.min.js")%>"></script>
If this is just ASP.net try adding ~
Example:
<script type="text/javascript" src="~/Assets/Includes/Javascript/jquery-1.4.2.min.js"></script>
Go with Gabe if you are using MVC. Otherwise, you will need to call Page.ResolveUrl to resolve the url because the ~ wont work in <script> tags.
<script type="text/javascript" src='<%= Page.ResolveUrl("~/Assets/Includes/Javascript/jquery-1.4.2.min.js") %>'></script>

Categories