'Sys is undefined' error javascript error - javascript

I've tried every solution I've found through Google, and I'm currently at a loss.
I have several projects which were created for .Net 2.0 and IIS6 Server 2003 32 bit, and are being migrated to IIS7 Server 2008 64 bit (I'm new to both IIS7 and Server '08). Right now any page that utilizes .Net AJAX is getting this 'Sys is undefined error' after migration. When I view source and try to view any *.axd file, I get a 404.
I've checked that my web.config has all the appropriate sections., with all "Version" attributes set to 1.0.61025.0 since I'm not currently upgrading from .Net 2.0. The Virtual Directories are created as applications, and the App Pool is set to .Net 2.0 Integrated.
I've checked that the *.axd Handler Mappings are there and set to "Unspecified Path Type". Also there are the appropriate *_AppService.axd and ScriptResource.axd mappings.
I'm not making any custom javascript references to Sys.
I've already tried repairing/reinstalling .Net on the server, and running aspnet_regiis via the command line.
I've also tried creating "blank" WebResource.axd and ScriptResource.axd files to put them in the project. While they eliminate the 'Sys is undefined' error, it also breaks functionality within any page looking for that file.
Do I have any other options? Did I miss something else, or did I make a mistake in the steps I've already taken? Any insight you guys could provide is much appreciated. Thanks!

Removing the ScriptResource.axd Handler mapping resolved my problem once.
Also we had done this at that time,
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"></modules>
</system.webServer>
Hope that helps you out (^.^)

Related

ExtJS: Empty File Name (only .js?_dc=20181..) - 404 Error

For a long time I keep facing with this problem and unfortunately sencha forums is not helping anything about. Therefore I had to bring up here.
I'm try to developing a simple weather panel. During displaying application on localhost environment it works all good but when it goes to live version it gives this error below and whole application is not working;
GET http://www.myapp/.js?_dc=20180112155627 404 (Not Found)
fetch # (index):89
fetch # (index):99
loadSync # (index):103
load # (index):103
loadEntries # (index):95
processRequest # (index):85
loadSync # (index):85
load # (index):85
As environment we are using Jenkins and classic toolkit during release version and this is Jenkins' commands;
Started by GitLab push by nengin
+ sencha app build classic
I've used Geolocation feature for weather panel but because of this problem I thought it keep raises error so I've take it out but still application keep give this error. On sencha forums they've suggested to me
it happens because of a missing file/ required file. Use sencha app build testing to find out which file is missing. As well comment modern toolkit statements on app.json to avoid errors related with unnecessary classes.
Well.. I did all but still if I'm not disabled weather-panel item on Dashboard class and push it to repository, Jenkins takes commit and build the live version to internet. And keep gives this error above!
Below you will find some code snippets of weather-panel, what could exactly be the reason for this error? I really need some idea.
Here is whole code blocks of weather panel # http://www.text-share.com/view/b53bd4fd
Thanks in advice.
UPDATE
Through #Alexander's comment:
So I've got this WARN on console: [W] [Ext.Loader] Synchronously loading 'Ext.data.proxy.JsonP'; consider adding Ext.require('Ext.data.proxy.JsonP') above Ext.onReady bootstrap.js:867
I've used JsonP on weatherdata class and it doesn't include JsonP inside requires. Now I've added JsonP and now the WARN is gone! So will it run without empty-file error on server with compiled application?
#Alexander 's comment has been the solution;
Please open the browser console, then work with the uncompiled app like it were the compiled app, and check for any occurrences of "Synchronously loading ..., consider adding ..." warnings. Make sure to fix all these warnings, because they cause the issue.

Bug in Visual Studio 2015 package.appxmanifest for ms-appx-web in start page?

I'm creating a Javascript Windows 10 Universal app. It complained about using javascript inline with html-- due to having script tags inside my .html file.
"CSP14312: Resource violated directive 'script-src ms-appx: 'unsafe-eval'' in Host Defined Policy: inline script. Resource will be blocked."
So I did some research online and it turned out that I could avoid this error by doing two things:
Open package.appxmanifest:
add to start page:
StartPage="ms-appx-web:///index.html"
Add to package.appxmanifest:
<uap:ApplicationContentUriRules>
<uap:Rule Match="ms-appx-web:///" Type="include" WindowsRuntimeAccess="allowForWebOnly" /> </uap:ApplicationContentUriRules>
(You read this right: we need 3 slashes... ///)
Now this works great and my program is running now without the errors. But I noticed that if I change the start page via the GUI then it can't save it because it complains it's an illegal uri. So the only way I could do this was right-click the package.appxmanifest and choose "view code" and then do it through code. (Actually #2 above can only be done through code).
Maybe someone can clue me in, did I do something wrong? Here's a screenshot doing this through the GUI:
I saw a similar bug has been filed - when use the same uri format in manifest's Content URIs setting, same issue occurs. It's because the there is a rule checks whether the uri has a host. If the uri's host is null or empty, the uri validation fails.
Seems VS team is considering removing this rule, so I think it will be fixed in future release but I cannot say which update will have the fix.

.htaccess configuration for HTML5 History API

After several days of digging at the HTML5 History API, I found this great working example that suits my needs https://github.com/pinceladasdaweb/html5-history-api
However, when trying to run it on my local server/web hosting, I get an Internal Server Error, which leads me to think that there's something misconfigured in the .htacccess file.
Looked up at the Apache Error log and confirmed my theory, this was what error line tells:
"[...]
.../html5-history-api-master/.htaccess:
Invalid command 'RewriteEngine', perhaps misspelled or defined by a
module not included in the server configuration"
I'd like to know if I need to make specific configurations in the server to make the example run properly.
You can see a working demo done by the owner here: http://www.pinceladasdaweb.com.br/html5-history-api/
Any help will be really appreciated.
Thanks!
This is what I have done to make it work.
1- As Panama Jack said in the comments, the answer of what was happening was in the log file wamp\logs\apache_error.log
[...] /html5-history-api-master/.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration
2- I enabled the rewrite_module on my local server (see Hardik Thaker for your visual reply to this post!
3- My web hosting is GoDaddy, I found out that I had to tweak the .htaccess file to make it work. This last post saved my life!
Hope it helps!

405 error not allowed whereas I have javascript error [duplicate]

I am trying to host an ASP.NET MVC4 web application with IIS 7.5. When debugging the app everything works fine (I'm assuming this is because of Windows Authentication).
However, when I publish the app and browse to it I get a 405 Method not allowed error:
POST http://localhost/ 405 (Method Not Allowed)
send
i.extend.ajax
i.(anonymous function)
(anonymous function)
From what I've been reading this is either a problem with the Handler Mappings in IIS or some configuration is needed in the web.config. Either way, I have not found the correct solution.
Could anyone tell me what my web.config should include to all POSTS? And/or how to set up the correct Handler mapping in IIS, as I am new to web development and find the number of options a bit overwhelming.
The piece of javascript that throws the error is the following:
$.post("/", { latitude: locLat, longitude: locLon, username: $('#onlineUsers').attr('itemid') });
A 405 is thrown by IIS when an HTTP verb(GET,PUT,POST,DELETE,HEAD,etc.) is requested and is not supported/disallowed by the designated handler.
You'll need to open the IIS manager -> Default Web Site -> Handler Mappings (Or the handler mappings specific to your web-application)
In here you'll need to play with the handler mappings as one of them is not allowing "POST" verbs.
As you are not posting to any specific page (.aspx, .ashx, etc.), it will be difficult to identify the exact handler that is causing you issues.
Handlers of interest may be:
ExtensionlessUrlHandler-ISAPI-4.0_32bit /64bit
StaticFile
Once you identify the handler your request is being routed to, double click it to open the dialogue.
From there click "Request Restrictions" then "Verbs"
Make sure the appropriate verb is present in the text area.
As I mentioned before, I'm not sure which handler is handling your request as you are not posting to any particular page (you may have URL re-writing in place that is routing your request appropriately).
If the above fails, you may need to check if WebDAV Publishing is installed and remove it (restart required).
Maybe you should modify your post'URl format like this:
$.post('#Url.Content("~/Attach/UpdateAttach")'
some users here are having shared hosting and not dedicated servers, so they might not be able to get access to the IIS control panel..
this is my case and here is what I found..
I have my web application on the root directory created through Godaddy control panel.. and the POST request is acknowledged ..
then I used the FileZilla to create a testing folder for my jquery ..( notice i used FileZilla , so the web application and hence the IIS of GoDaddy is not aware that I wanted this folder to be part of my we application )
then whenever I test this jQuery on this testing folder.. I get that error [405 Method not allowed]..
the solution was extremely simple :
I moved my testing page out of that testing folder created by FileZilla and located it inside a folder that was created through Godaddy control panel ( in this case the IIS will be aware that this page is part of my web application :) )
Hope that will help those on Shared hosting

Hosting phono (jquery softphone plugin) dependencies locally?

This may be too obscure a question, but perhaps someone can spot what I'm doing wrong.
Phono (jquery plugin for javascript/flash-based softphone built on top of Tropo/Voxeo) loads a couple of dependencies from the phono.com servers. Namely,
flensed.js
checkplayer.js
swfobject.js
phono.audio.swf
I would very much like to avoid loading these dependencies from an external server (for obvious reasons) and going by this thread on their forums (which I can't register for because it appears every possible username has been "taken") , it should be possible to host them locally.
Here's a prettified source for the main jquery plugin. Maybe I'm just bad at looking, but I could not find a commented, un-minified version either in their full SDK or on github.
So after changing
base_path: "http://s.phono.com/deps/flensed/1.0/"
and
swf: "http://s.phono.com/releases/" + Phono.version + "/plugins/audio/phono.audio.swf"
... all dependencies seem to load just fine, phono successfully grabs a session ID and chats by SIP appear to be working. When I try to dial out or call the session id/SIP, however, I get a javascript error:
Uncaught TypeError: Cannot call method 'start' of null
referring to line 770 : h.start().
this.$flash.play(g, j); appears to return null or undefined. I suck at javascript and can't figure out why.
EDIT - if anyone would be so adventurous as to try this out, you can just grab their "kitchen sink" demo and slap it up on a server without much hassle.
Okay -- this is ridiculous and I'm an idiot for not catching it sooner.
Flash was trying to load the ringtones off my server at the URL that requires authentication. Unfortunately, flash is not a user with a valid session. Hence, flash was grabbing big handful of nothing. Sorry.
You can download the PhonoSDK and all of the samples (including the kitchen sink demo) and run it on your localhost. Here's the link: http://s.phono.com/releases/PhonoSDK-0.2.zip. It's open source, do you can also fork/contribute to the project as well - https://github.com/phono
I just tried it using Apache on my localhost it worked without editing anything.

Categories

Resources