Scroll function disabled locally, still working on live site - javascript

Hi all I have to make updates to a site one of my predecessors created years ago. The smooth scroll has failed to load its resources thankfully the live site is still functioning as it should http://www.asla.org/greenroof/index.html
I also just want to add that the local files threw no errors about a month ago when I last checked locally.
I will need to upload the index.html file along with new images to make the updates. I assume this will not change or disable the functionality of the live site.
Currently just trying to get the scroll to work locally. This cursor .cur element I cant find anywhere so I assume its part of a jquery library.
Any ideas? Thanks again.
Here are the errors I'm getting I have no idea how to fix this. Help would be appreciated.
console
index.html
jqueryLoader.js line 23 and 109
jquery.tools.min.js line 174
e&&e.document?e.document.compatMode==="CSS1Compat"&&e.document.documentElement["client"+b]||e.document.body["client"+b]:e.nodeType===9?Math.max(e.documentElement["client"+b],e.body["scroll"+b],e.documentElement["scroll"+b],e.body["offset"+b],e.documentElement["offset"+b]):f===w?c.css(e,d):this.css(d,typeof f==="string"?f:f+"px")}});A.jQuery=A.$=c})(window);
Here is also the CSS
Server doesnt even have /cursor directory from path specified by console
Update 3/25/15
Local site scroll works fine returning no errors when set up on local web server MAMP. Quite strange how accessing the site via file:// stopped working randomly.

If you just want to do a local test you can go through the css and rename
background-image: url (../images/cursor/rightArrowoutline.png);
background-image: url (../images/cursor/curspr_arrow_right.cur)
background-image: url (../images/cursor/curspr_arrow_left.cur)
to
background-image: url ('http://www.example.com/greenroof/images/cursor/curspr_arrow_right.cur')
background-image: url ('http://www.example.com/greenroof/images/cursor/curspr_arrow_left.cur')
example.com would be the name of the live domain.
If you want a production ready file when you are done, I would set up a local web server. Check out all of your source files and make a local version of the site.
MAMP is a pretty fast setup.
http://en.wikipedia.org/wiki/MAMP
Update: 3/10
It looks like the cursors are in two places on your servers files system.
Do you have both directories with the files?

Related

How to insert trigonometrical shape in webpage?

I am working a project in which I have to insert thousands of trigonometrical shape in a webpage. Basically I'm working on a project of converting an ancient book in html. But the problem is- drawing a svg in Adobe illustrator or in any software is time consuming and managing thousands of svg shape in one html page seems very difficult for us. I have searched a lot in stack overflow to draw a shape quickly and I found this library which convert latext into svg which seemed to be a great solution for us. See a live demo here. We simply create a shape in Mathcha and copy the latext of the shape and insert it in our html page.
But the problem is when we import the tikzax Library in the head of our html page and insert the latext code of that shape (as instructed in the documentation) in the body like this:
<script type="text/tikz">
\begin{tikzpicture}
\draw (0,0) circle (1in);
\end{tikzpicture}
</script>
we can't get the ouptut. It only shows a blank html page . The latext code does not effect in any part of the html page. In short we are unable to render the latext in html. Can someone please explain how to render these latext into svg on a webpage. we are unable to find a way to get of it.
Can someone please explain how to render these tikz latext into svg format in a webpage ?
I've attached the screenshots of the html code and the output of it in the chrome browser.
Screenshot of Code:
Output of the Code in Google Chrome (Blank page) as I have told:
I tried to setup the example and ran into two issues. I'll explain how to solve those. However, before you do this, try opening your own example again. After I fixed the issues, I went back to look more closely at the problems, but.. it worked. There is a small chance that the maintainer of the files adjusted the CORS-Headers just while I tried this out - so maybe your problem solved itself. In case it doesn't work for you just like that, here is how I solved the initial problems:
The library doesn't allow requests from other domains, so you can't just include the JS file from tikzjax.com. To solve this, you have to download the source files and put them in the same folder. The js file itself is not enough, you have to download these files:
https://tikzjax.com/v1/tikzjax.js
https://tikzjax.com/ef253ef29e2f057334f77ead7f06ed8f22607d38.wasm.
https://tikzjax.com/7620f557a41f2bf40820e76ba1fd4d89a484859d.gz
Then change your script tag to that local js file: <script src="./tikzjax.js">
The script uses fetch to get other files, and this is not working, when opening the page with the file:// protocol (you'll get this error message in the console: Fetch API cannot load file:///ef253ef29e2f057334f77ead7f06ed8f22607d38.wasm. URL scheme must be "http" or "https" for CORS request.
So you have to setup a local webserver to show the page on e.g. http://localhost:8080. If you're comfortable with the command line, you can use the npm package http-server for such cases. If you haven't installed npm and/or node, you can install it from here (npm is installed with node). Then run the command npm install -g http-server. Then navigate to the folder where your html and js files are (in the terminal) and execute http-server. This will setup the server and the circle should render there.

Why CSS,JS and images are not loading in webpage? I've following every possible solution. It's first time I'm experiencing this in codeigniter

Why CSS,JS and images are not loading in webpage? I've following every possible solution. It's first time I'm experiencing this problem in codeigniterenter image description here
Advice: Try to don't use ../../../.. to load a file as you do for "online lib", if you use a cdn, just load like that:
<script src='//www.google.com/recaptcha/api.js'></script>
For your issue, we don't know where are the files you load, but often when you want go to root with xamp or wamp with base_url, you are in "localhost", so if your project is in a sub directory, it will return a 404 cause the file doesn't exist.
I'm sure if you go on "network" tab on your browser (mine is chrome), you will see only 404. Example:
https://i.stack.imgur.com/EXoVa.png
You can right click on a link, and open it on a new tab to see what is the file/image URL in your browser. Here is the issue :-)

Glassfish not updating JavaScript files

I have been using Glassfish 3.1 for a web project, even after updating a JavaScript file, and re-publishing the whole project onto the glassfish server, server seems to execute the older version of file.
I have tried, restarting the server, but everything went in vain.
Thanks in advance.
In my answer I assume you are entirely sure that even if you packed an updated script still the old script version is rendered on the page. However I would advice to double check it.
You have some options here:
First option
If it is a developer machine and just one time problem with cache you can quickly fix it by deleting applications, generated and osgi-cache folders from your GLASSFISH_HOME. Before you should stop your AS though.
Second option
If you do not want your page to be cashed you can create a javax.servlet.Filter and add Expires header to a response in the doFilter method. If you use some date in the past the page will never be cached.
((HttpServletResponse) resp).addHeader("Expires", "Mon, 8 Aug 2006 10:00:00 GMT");
Alternatively you can calculate a value and that would be your strategy for caching.
Third Option
You can add a parameter to your page URL. For example http(s)://{YOUR_URL}/${PATH_TO_PAGE}?version={APP_VERSION}
You do not have to read or process this parameter, so you do not care about either its name or value, but if in your application you will increase {APP_VERSION} each time you upgrade your app and navigate to the page adding this parameter, it will make the page URL unique for each application version and you can be sure cached version from previous version is not used. This way of course a bit awkward, nevertheless it is still an option. BTW this is a good way to check if you really ran into a cache related problem. Just add a random parameter to your page URL with a random value and you should see the latest script version.
Forth Option
You can somehow combine these option
Hope that helps
This is not a Glassfish problem. This is because your browser caches the js files.
You just have to clear your browser cache.

Get URL and redirect before page load

So, i have an interesting situation. I've been working on re-organizing a directory on a website. I updated old files there's about 100 of them, they are in a new location. The old files have been taken down.
The problem I have is there are probably hundreds of people that have bookmarks directly to the URL of the old files. (e.i. "wahwah.com/subSite/pdfs/something.pdf") these files are 5 years old so they need to find the new ones anyways.
So instead of having a page for each individual file, Can I have something in the directory that used to house the files to watch for that URL and redirect to the new page?
It would watch for "wahwah.com/subSite/pdfs.." and redirect. Or maybe something in the main directory of this subSite to watch for the URL to have the /pdf path in it.
I know I can grab URLs in java script but that doesn't help me unless I can do what I stated above. I'm not sure how if at all I could do it in .NET. our servers support .NET because most of our site apps were made with it but I don't deal with those. I cannot use PHP, the servers don't use it.
I'm hoping JavaScript will be able to do it somehow, but it's something i've never tried before so just thinking about it i'm not sure I can. I'm not much for using JS libraries so Im not sure what is out there i've been searching a bit though.
I found Grunt but i'm not entirely sure how it works just yet. Just looking around maybe the file filter or matchBase. or some of the Global patterns.
If you have access to server, your best option is to set up redirect in there on wahwah.com/subSite/pdfs/ directory.
How to do this depends on if you're on IIS or unix.
In asp.net, 301 redirect is fairly efficient.
if (HttpContext.Contains("http://old.aspx"))
{
HttpContext.Current.Response.Status = "301 Moved Permanently";
HttpContext.Current.Response.AddHeader("http://www.new.aspx");
}
Or in page load you can write:
Response.Status = "301 Moved Permanently";
Response.AddHeader("Location","http://new.aspx");

changes to javascript file "ignored" in VS2010

I have a javascript file harSympCode.js that I am trying to make changes to. It is used in 5 aspx pages - .NET 4.0 & VS2010 - and needs to remain consistent for all 5.
In the js file there is a function startstop() which triggers a floating clock to count. It is called in the onload event of the body tag. It works just fine. There is another function (call it function1()) which is supposed to load some values to a form. It is almost identical to a second one (call it function2()) in the file except the second one does a form.submit() when it is done. I am attempting to modify function1() to also submit the form when done BUT no matter what I do, I can not get the system (VS2010 localhost) to recognize the 2 lines of code I added. Since they are working just fine in function2() and I don't see any error codes or warnings when I rebuild the website, I can only guess that the changes are being ignored.
What I have tried:
Removed the <script> tag from the aspx pages: Result - startstop(), function1() and function2() are not found.
Added the <script> tag back in but removed the script file from the solution/project directory structure: Result - everything runs as if the file was still there.
Deleted sln and suo files and reopened the website while at the same time trying options 1 and 2: Results - same as 1 and 2.
I have looked through my entire directory structure and renamed and/or deleted every version of the js file I could find, to no avail.
I have looked for anything and everything related to precompiling a website (NOT application) and attempted to make changes to a supposed "Precompile" directory but a) could not find the directory and b) all changes I made were ignored and/or reset the next time I went and looked.
Has Anybody seen this and how did you fix it?
This does not seem like an IDE issue as mentioned in your comment. Make sure you set your browser to refresh the cache on each load. In IE:
If you're using Chrome, then cache is cleared from the dev tools and is very persistent. Also refresh the page using CTRL+F5. You also want to make sure that you're not getting compilation errors and your project isn't running from the previous working version. However point 1 of what you've tried suggests that the generated HTML page refreshes when you run your project but your browser cache contains the javascript files and so when the script tag exists it finds the cached ones and executes them. So you can use the 2nd button from the top (Clear Browser Cache...) to remove them.
I had been having this issue, clearing my cache and wondering why VS2010 kept looking at the old file, even though it appeared as the new version in F12.
The solution turned out to be that TFS had the file locked, and that once I checked out the javascript in question, the debugger picked up the new version.

Categories

Resources