How to See Errors In IE 7 - html

I am using javascript and ajax the most in my project source. All functions are working well in firefox. But some of them are not working in ie 6 and 7 browsers. Mainly Delete is not working for any page in my project. I dont know how to resolve those bugs. And dont know how to see errors in ie browsers.. So Plz help me to resolve this issue. Thanx in advance

Download and install Internet Explorer Developer Toolbar and test your pages. Since you said you are using AJAX I think error can be javascript related.
In IE javascript errors are shown on the left hand side of the status bar (bottom).
You can also make IE show notification about error message by going to
Tools-> Internet Options -> Advanced
[Tab]
and choose "Display a notification about every script error".
Please post more info about your issue.
What is happening when you call the "delete" function?
What is it supposed to do?

Tools -> Internet Options -> Advanced -> Enable Script debugging.

create try-catch statements in your code, and alert or print error messages recieved in the catch clause:
try {
somethingThatDoesntWork();
} catch(e) {
alert(e.message);
}
Using this with the other tips on getting some proper debugger running should help quite a lot (:

Related

Safari mailto: "This website has been blocked from automatically composing an email."

When using Safari (iOS 10.2) and clicking on a mailto link a confirmation prompt is shown with the following message:
"This website has been blocked from automatically composing an email."
Ignore / Allow
I'd like to get rid of this on my own site and don't know what to do. It can be reproduce with Safari e.g on any BBC article clicking the mail icon.
Screenshot of dialogue on iPad
My web research brought me to these links:
https://discussions.apple.com/thread/7763735
WillieFromColo Jan 11, 2017 8:25 AM in response to Russ G
Issues with Safari and "This website has been blocked from
automatically composing an email."
My research on Google suggests that this Error-type Message started
happening in about November with an update to Safari, which likely
occurred concurrently with Apple's update to iOS 10.2. As of today
(1/11/17) that is the latest version of iOS for iPads and perhaps
iPhones, too.
[...]
and
https://developer.apple.com/safari/technology-preview/release-notes/#r15
Release 15
URL Handling
Navigations to tel: and mailto: links now require a user gesture;
navigations without a user gesture will show a confirmation prompt
So it seems like a Safari "feature". Does anyone know how to prevent this prompt?
Various third party JavaScript libraries will intercept clicks on a tags in order to prevent navigation briefly while sending data to a server. Typically, they programatically trigger navigation via window.location.replace.
The change in Safari pops the warning when mailto/tel links are triggered in this way.
There was an interaction, but that's usually been stopped with preventDefault, and Safari doesn't care.
If you're using a library that's causing this issue, contact the creator and see if they can update it to skip preventDefault on mailto/tel links.
What i did not mention initially was that we called the mailto from the JavaScript part of out page. We now again tried to solve the issue by changing to a HTML Tag based mailto (with to and subject) and it now somehow works without that dialouge.
So i assume this issue solved for myself, but i am open to any hints explaining the reasons. Therefor by now i do not flag this answer as the solution.
Happened for users because we used window.open(...) to open that link in new window.
Replaced to window.location.href = ... just for Safari :facepalm:.
We have encountered a similar issue - and have identified the issue as being triggered via Google Tag Manager.
Specifically we were triggering the event (in Tag Manager) on all href elements that contained a mailto: prefix.
We altered the event to be triggered via a click on a nested <span> element inside the anchor tag.
This allowed both the tracking of the event in Tag Manager and removed the offending user prompt.
eg.
<span>link text</span>
We got this issue when tracking mailto-Links with Google Tag Manager.
I've found a solution without modifying the dom.
We had activated the trigger type "Click - Just Links" with the option "Wait for tags" with a "Max wait time" of 2000 Milliseconds.
After disabling this option, the message did not show up again.
Another solution is to use "Click - All Elements" (this always works).
None of the solutions in here worked. There was a plugin/script that was attaching itself to click event which was causing this behaviour. I finally used jquery to create the mailto: links with jQuery.
Add emails in html in this manner
<span class="email-link">email#email.com</span>
and add this jquery to transform the <span> to a link
$(function() {
$( ".email-link" ).each(function( index ) {
var a = $('<a />');
var link = $( this ).text();
a.attr('href', 'mailto:' + link );
a.text(link);
$( this ).html(a);
});
});
This way you can avoid any external scripts attaching to the mailto link click event.

How to see what's <omitted> in Chrome debug console

I am using Knockout.js, and the most important part of the error message is (nowadays) often hidden under the <omitted> part. I tried hovering over, and clicking a lot of stuff, but I can't find a way to see the full message. Does anyone have a tip?
Thanks in advance!
PS: I'm looking for a fix within the Chrome settings. So without cluttering my code with extra window.onerror stuff or otherwise. I don't want to clutter my code just because the Chrome development team thought it was a good idea to omit debug text :S
For a code hack, see this answer: https://stackoverflow.com/a/22218280/647845
Here's a little bit of code that will output the whole error message:
window.onerror = function (errorMsg, url, lineNumber, columnNumber, errorObject) {
if (errorObject && /<omitted>/.test(errorMsg)) {
console.error('Full exception message: ' + errorObject.message);
}
}
You can execute this in the development console in Chrome, so it doesn't have to be in the actual code of your web page.
Use Firefox. And vote up for this issue in the meantime:
https://code.google.com/p/chromium/issues/detail?id=331971

Why always getting Nullpointer when doubleclicking link on XPage?

I have a difficult problem: I always get a Nullpointer exception on my webpace, when I
rapidly click on the same link. Or when I reload the page rapidly.
This is the error I get:
java.lang.NullPointerException
com.ibm.xsp.webapp.FacesServlet.acquireSyncToken(FacesServlet.java:285)
com.ibm.xsp.webapp.FacesServletEx.serviceView(FacesServletEx.java:161)
com.ibm.xsp.webapp.FacesServlet.service(FacesServlet.java:160)
com.ibm.xsp.webapp.FacesServletEx.service(FacesServletEx.java:138)
com.ibm.xsp.webapp.DesignerFacesServlet.service(DesignerFacesServlet.java:103)
com.ibm.designer.runtime.domino.adapter.ComponentModule.invokeServlet(ComponentModule.java:576)
com.ibm.domino.xsp.module.nsf.NSFComponentModule.invokeServlet(NSFComponentModule.java:1281)
com.ibm.designer.runtime.domino.adapter.ComponentModule$AdapterInvoker.invokeServlet(ComponentModule.java:847)
com.ibm.designer.runtime.domino.adapter.ComponentModule$ServletInvoker.doService(ComponentModule.java:796)
com.ibm.designer.runtime.domino.adapter.ComponentModule.doService(ComponentModule.java:565)
com.ibm.domino.xsp.module.nsf.NSFComponentModule.doService(NSFComponentModule.java:1265)
com.ibm.domino.xsp.module.nsf.NSFService.doServiceInternal(NSFService.java:653)
com.ibm.domino.xsp.module.nsf.NSFService.doService(NSFService.java:476)
com.ibm.designer.runtime.domino.adapter.LCDEnvironment.doService(LCDEnvironment.java:341)
com.ibm.designer.runtime.domino.adapter.LCDEnvironment.service(LCDEnvironment.java:297)
com.ibm.domino.xsp.bridge.http.engine.XspCmdManager.service(XspCmdManager.java:272)
Question: Can someone explain in detail what this acquireSyncToken does? Maybe then I can find the bug...
In my XPages I use
sessionScope.get(key) // same with applicationScope
sessionScope.put(key, value) // same with applicationScope
a LOT ;)
I tried very much, e.g. to wrap my lookups within
synchronize(applicationScope){
// lookups and so on...
}
and stuff like that, but that only made it worse, so I removed the synchronize-stuff...
Environment:
Domino Server 8.5.3 FP1
XPages
testing on modern Browsers like FF, Chrome
MacOS / Win7
Architecture:
I have one BIG xPage, where I basically add some CustomControls and due to the current URL embed another XPage.
Inside the CustomControls and XPages I have more Custom Controls and I added some Views as Datasources and did the wildest things with "repeat controls" and SSJS inside Computed Fields.
The heavy-weight DB-Lookups are cached in the applicationScope.
For more Info, please ask!
Thanks in advance!
This is a known issue. IBM advises to downgrade from FP1 or FP2 to 8.5.3 or UP1.
See Dojo xhrGet with sync:false issue with xe:viewJsonLegacyService and Domino 8.5.3 SP1 or http://www-01.ibm.com/support/docview.wss?uid=swg1LO71603

HTML / Javascript One Click Print (no dialogs)

Is it possible to have a print option that bypasses the print dialog?
I am working on a closed system and would like to be able to pre-define the print dialog settings; and process the print as soon as I click the button.
From what I am reading, the way to do this varies for each browser. For example, IE would use ActiveX. Chrome / Firefox would require extensions. Based on this, it appears I'll have to write an application in C++ that can handle parameters passed by the browser to auto print with proper formatting (for labels). Then i'll have to rewrite it as an extension for Chrome / Firefox. End result being that users on our closed system will have to download / install these features depending on which browser they use.
I'm hoping there is another way to go about this, but this task most likely violates browser security issues.
I ended up implementing a custom application that works very similar to the Nexus Mod Manager. I wrote a C# application that registers a custom Application URI Scheme. Here's how it works:
User clicks "Print" on the website.
Website links user to "CustomURL://Print/{ID}
Application is launched by windows via the custom uri scheme.
Application communicates with the pre-configured server to confirm the print request and in my case get the actual print command.
The application then uses the C# RawPrinterHelper class to send commands directly to the printer.
This approach required an initial download from the user, and a single security prompt from windows when launching the application the first time. I also implemented some Javascript magic to make it detect whether the print job was handled or not. If it wasn't it asks them to download the application.
I know this is a late reply, but here's a solution I'm using. I have only used this with IE, and have not tested it with any other browser.
This Sub Print blow effectively replaces the default print function.
<script language='VBScript'>
Sub Print()
OLECMDID_PRINT = 6
OLECMDEXECOPT_DONTPROMPTUSER = 2
OLECMDEXECOPT_PROMPTUSER = 1
call WB.ExecWB(OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER,1)
End Sub
document.write "<object ID='WB' WIDTH=0 HEIGHT=0 CLASSID='CLSID:8856F961-340A-11D0-A96B-00C04FD705A2'></object>"
</script>
Then use Javascript's window.print(); ties to a hyperlink or a button to execute the print command.
If you want to automatically print when the page loads, then put the code below near tag.
<script type="text/javascript">
window.onload=function(){self.print();}
</script>
I am writing this answer for firefox browser.
Open File > Page Setup
Make all the headers and footers blank
Set the margins to 0 (zero)
In the address bar of Firefox, type about:config
Search for print.always_print_silent and double click it
Change it from false to true
This lets you skip the Print pop up box that comes up, as well as skipping the step where you have to click OK, automatically printing the right sized slip.
If print.always_print_silent does not come up
Right click on a blank area of the preference window
Select new > Boolean
Enter "print.always_print_silent" as the name (without quotes)
Click OK
Select true for the value
You may also want to check what is listed for print.print_printer
You may have to choose Generic/Text Only (or whatever your receipt printer might be named)
The general answer is: NO you cannot do this in the general case but there some cases where you might do it.
Check
http://justtalkaboutweb.com/2008/05/09/javascript-print-bypass-printer-dialog-in-ie-and-firefox/
If you where allowed to do such a thing anyway, it would be a security issue since a malware script could silently sent printing jobs to visitor's printer.
I found a awesome plugin by Firefox which solve this issue. try seamless printing plugin of firefox which will print something from a web application without showing a print dialog.
Open Firefox
Search addon name seamless printing and install it
After successful installation the printing window will get bypassed when user wants to print anything.
I was able to solve the problem with this library: html2pdf.js (https://github.com/eKoopmans/html2pdf.js)
Considering that you have access to it, you could do something like that (taken from the github repository):
var element = document.getElementById('element-to-print');
html2pdf(element);

Widget object is undefined in Dashcode

I'm using Dashcode for a mobile Safari web application and from the documentation (https://developer.apple.com/library/archive/documentation/AppleApplications/Conceptual/Dashcode_UserGuide/Contents/Resources/en.lproj/MakingaWidgetwithDashcode/MakingaWidgetwithDashcode.html), it appears that I should be able to access an object called "widget".
However, when I tried, I get the error message saying that widget is undefined. I've also tried "window.widget" and it gives me the same error.
What's going on?
I'd like to make a text in my application a clickable link to open a URL using openURL (like the example given at the URL above).
You use widget.xxx to access things inside and outside you widget.
So to access curl and the Mac and get some data from Yahoo you do as follows
var yahoorate = widget.system("/usr/bin/curl 'http://download.finance.yahoo.com/d/quotes.csv?s=EUR" + interim0 + "=X&f=l1'", null).outputString;
to get a preference key value, stored in the widgets plist when you install on a mac
globalPreferenceValue = widget.preferenceForKey(null, "your-key");
i think in the question ask (below) we are checking to see if we are in a widget and then preparing a transition to the back of the widget.
if (window.widget) {
widget.prepareForTransition("ToBack");
}
this is how i set a preference so it is stored between system reboots (you use a get preference to retrieve them)
widget.setPreferenceForKey(2,"ratePrecision");
and this is how you create a link to open in a browser not the widget
<a onclick=" + "widget.openURL('http://www.wf.com/private/?ID=636');" + "><span id=company-info>click here</span></a>
These are all rel working examples from widgets i have built. Hope it helps. I found it useful to download widgets that performed similar functions to ones i wanted and then as well as installing them opening them as projects, you can import, and then you can see all the code.
Ok, this worked...hope it will help someone else...
window.location = "http://www.apple.com";