I have created a payment system using Jquery. The problem I run into is when I move from http to https. I get the following error: Error: [Exception... "Access to restricted URI denied" code: "1012"
We have a javascript that is vulnerable to XSS because the input to the script is not being checked for strings such as "javascript", "eval", "script" etc. I have seen some snippets of code here and there on how to check the strings but I have not yet found a comprehensive js library that will clean user input of all offending characters. What complicates it is that phishers can encode characters to bypass the usual amateurish attempts to clean strings of offending characters.
I am using GreaseMonkey to load jQuery 1.3.2 (there is a bug with the latest version of jquery and GM) and jQuery UI 1.8.0.I am using jQuery via GM to manipulate the GUI of a content management system. This CMS uses its own JS library to dynamically add stuff to the dom.
Question:How can I target a dom element that was added to the dom via this other JS lib?In other words, the CMS will add a div to the dom, and I am not sure how to tell jquery to wait for these elements to "be there" before applying the jquery goodness. Specifically, I would like to do this:
$(function() { $('#zen1227').resizable(); });
But "#zen1227" does not "appear" until later via this other JS library.
I am recentlyexperiencinga problem with .ajax calling cross domain asp.net webservice. It started working fine, until the data returned from server is becoming too big and suddenly the ajax call caused errors, if i reduce the data length then the error went away. After doing some debug, i have identified the problem being the callback was inserted into the returned data.
Is it possible to use $.ajax to call an external web service directly, or do I need to write a dot net server-side wrapper to consume the web service, then call the wrapper from jQuery ?
I have attempted a direct call as shown below, which works fine in IE but generates an error in Firefox, which I presume relates to the cross-domain scripting issue.
I trying to make a call to an external domain using $.ajax() and it WORKS, the server receives the call, but the response in firebug errors out in jquery.js line 7760. I've been beating my head at this all day and don't feel like I've made it much further.
I suspect it has something to do with the dataType or type of the request. But I've tried all kinds of things from POST to GET to JSONP in the type. For dataType, I've also tried "html", "text", "xml", "json", and even some combos of "text html" but no success.
I want to bind a hook to objects member variable change event i.e. lets say I have object: var obj { var1 : 1, var2 : 2, var3 : 3 };
I want to call "Magical" function like this: onVariableChange(obj, "var1", function(obj, varname, old, new) { alert("Variable " + varname + " changed from " + old + " to " + new);}); And after this function call every time obj.var1 is set to some value have my callback function called
I found something in internet: [URL]. Its cool but: -It is changing Object-s prototype -It is not working under IE 5, 6, 7, 8, 9, 10, 11, 12.... I've changed it a little bit and instead of adding to Object class prototype I'm adding it as member to any object which needs this hook. But IE still doesn't work. Is there any known cross-browser solution for this? I remember there was a jQuery upcoming project which would allow users to bind object to form and by changing one other will change automatically I wonder whats that project name and how they change input value when object member value changed.
I'm writing a web page, which should interact with pages on another server using an iFrame. I want to use a form on the parent page to post to the URL on the iFrame and capture the response, without reloading the parent page.
Here are the details:I have a FORM on the parent JSP page, with some session data in hidden fields. The point to note is that the whole session data is on the client side, in encrypted form. This data should be posted to the server for each request, synchronous or asynchronous.Now, I need to call an application on a server on a different domain. For this purpose, I am using an iFrame. The session data in the parent page should also be passed to the application in the iFrame.
I know about the same-origin policy and that one of the only ways to load data from a cross-domain is to load it as JSON. However, all I am trying to do is access data from a server on another port (which I believe the browser still treats as cross-domain). I need to do this because the server my application is on is a map server and the other server (Apache) is the only one that can handle php scripts. I have also tried out the plug-in from [URL] and while it works when I do $('#phpContent').load('http://www.google.com'); it doesn't work when I try $('#phpContent').load('http://localhost:80/mapScripts/getFiles.php'); I have also tried$.get('http://localhost:80/mapScripts/getFiles.php', function(data) { $('#phpContent').html(data); });
So here I am breaking my brain and do not know what else to attempt.
Hides the element by sliding it down. $("div").click(function () { $(this).hide("slide", { direction: "down" }, 1000); }); I am new to Jquery. How do I reverse this code to slide element into viewport as opposed to slide out of view port. This is the link to the effect [URL]. What I want to do is the element will be hidden originally on loading the page and then slides into view with a click anywhere on the page, an anchor or after a few seconds.
Is there any way to resize an iframe dynamically to the height of its content that works cross browser and works when the iframe content is on another domain than the main page (I have access to both pages, so code can be put in either) Also, it must resize when links in the iframe are clicked (ie when a new page within the iframe is loaded)
Simple question really. The cross fade option used by default with cycle is not a linear one...it looks like it uses some kind of S curve because during the crossfade animation the background (meaning the area behind the images being cross-faded) becomes visible. Example screenshot taken mid-transition. The pink should never be visible behind the grey, but it is:
[Code]...
at the moment, which is leading to background visibility. Is there another fx option I should be using?
Is JavaScript able to send/listen for data on a specific port? I'm seeking a solution to real time data interaction with my web server that doesn't require refreshing the page. I.e., a chat room, where the data can be broadcast from the server arbitrarily and displayed by the client browser(s). To accomplish the data transmission can I use JS, or do I need to augment my client-side platform to something like Java, et al?
Basically, I want to have a javascript that will watch for data coming in on a specific port - like HTTP on port 80, etc. Is this at all possible with pure javascript?
I'm a newbie to javascript programming and I'm seeking on a solution on how to connect to a tcp port using javascript. Basically, we have phone server that is constantly streaming XML data on port 1024 (serverIP:1024). I've ran a packet sniffer and was able to gather the elements and attributes for the XML data that the server is streaming. Now, I have a test XML parser which works with the XML document using the elements and attributes i've gathered from the packet sniffer. Is there a way for me to connect to the TCP port i've mentioned using javascript and incorporate it with the XML parser that I have. code...
I have been directed from .NET section to this section. My original post and question are here. forums.devshed.com/net-development-87/asp-net-how-to-send-data-to-parallel-port-600691.html
Is it possible to send data to parallel port using javascript?
Okay, this an attempt to port PHP's date() function as much as possible to JavaScript. Could use some refactoring though. Any critique, comments, appraisal and any other opinion is very welcome. Feel free to discuss and also take a look at beetles code here: http://www.codingforums.com/showthread.php?s=&threadid=11069
Oh, and the date() function is described here: http://www.php.net/manual/en/function.date.php
Date.prototype.format = function (formatStr) { var heap = formatStr.split(""); var resHeap = new Array(heap.length); var escapeChar = ""; // you can change this to something different, but // don't use a character that has a formatting meaning, // unless you want to disable it's functionality
// go through array and extract identifiers from its fields for (var i = 0; i < heap.length; i++) { switch(heap[i]) { case escapeChar: resHeap[i] = heap[i+1]; i++; break;
case "a": // "am" or "pm" var temp = this.getHours(); resHeap[i] = (temp < 12) ? "am" : "pm"; break;
case "A": // "AM" or "PM" var temp = this.getHours(); resHeap[i] = (temp < 12) ? "AM" : "PM"; break;
case "d": // day of the month, 2 digits with leading zeros; i.e. "01" to "31" var temp = String(this.getDate()); resHeap[i] = (temp.length > 1) ? temp : "0" + temp; break;
case "D": // day of the week, textual, 3 letters; i.e. "Fri" var temp = this.dayNames[this.getDay()]; resHeap[i] = temp.substring(0, 3); break;
case "F": // month, textual, long; i.e. "January" resHeap[i] = this.monthNames[this.getMonth()]; break;
case "g": // hour, 12-hour format without leading zeros; i.e. "1" to "12" var temp = this.getHours(); resHeap[i] = (temp <= 12) ? temp : (temp - 12); break;
case "G": // hour, 24-hour format without leading zeros; i.e. "0" to "23" resHeap[i] = String(this.getHours()); break;
case "h": // hour, 12-hour format; i.e. "01" to "12" var temp = String(this.getHours()); temp = (temp <= 12) ? temp : (temp - 12); resHeap[i] = (temp.length > 1) ? temp : "0" + temp; break;
case "H": // hour, 24-hour format; i.e. "00" to "23" var temp = String(this.getHours()); resHeap[i] = (temp.length > 1) ? temp : "0" + temp; break;
case "i": // minutes; i.e. "00" to "59" var temp = String(this.getMinutes()); resHeap[i] = (temp.length > 1) ? temp : "0" + temp; break;
case "I": // "1" if Daylight Savings Time, "0" otherwise. Works only on the northern hemisphere var firstDay = new Date(this.getFullYear(), 0, 1); resHeap[i] = (this.getTimezoneOffset() != firstDay.getTimezoneOffset()) ? (1) : (0); break;
case "J": // day of the month without leading zeros; i.e. "1" to "31" resHeap[i] = this.getDate(); break;
case "l": // day of the week, textual, long; i.e. "Friday" resHeap[i] = this.dayNames[this.getDay()]; break;
case "L": // boolean for whether it is a leap year; i.e. "0" or "1" resHeap[i] = (this.getFullYear() % 4) ? false : true; break;
case "m": // month; i.e. "01" to "12" var temp = String(this.getMonth() + 1); resHeap[i] = (temp.length > 1) ? temp : "0" + temp; break;
case "M": // month, textual, 3 letters; i.e. "Jan" resHeap[i] = this.monthNames[this.getMonth()]; break;
case "n": // month without leading zeros; i.e. "1" to "12" resHeap[i] = this.getMonth() + 1; break;
case "O": // Difference to Greenwich time in hours; i.e. "+0200" var minZone = this.getTimezoneOffset(); var mins = minZone % 60; var hour = String(((minZone - mins) / 60) * -1);
case "r": // RFC 822 formatted date; e.g. "Thu, 21 Dec 2000 16:01:07 +0200" var dayName = this.dayNames[this.getDay()].substr(0, 3); var monthName = this.monthNames[this.getMonth()].substr(0, 3); resHeap[i] = dayName + ", " + this.getDate() + " " + monthName + this.format(" Y H:i:s O"); break;
case "s": // seconds; i.e. "00" to "59" var temp = String(this.getSeconds()); resHeap[i] = (temp.length > 1) ? temp : "0" + temp; break;
case "S": // English ordinal suffix for the day of the month, 2 characters; i.e. "st", "nd", "rd" or "th" var temp = this.getDate(); var suffixes = ["st", "nd", "rd"]; var suffix = "";
case "t": // number of days in the given month; i.e. "28" to "31" resHeap[i] = this.getDay(); break;
/* * T: Not implemented */
case "U": // seconds since the Unix Epoch (January 1 1970 00:00:00 GMT) // remember that this does not return milisecs! resHeap[i] = Math.floor(this.getTime() / 1000); break;
case "w": // day of the week, numeric, i.e. "0" (Sunday) to "6" (Saturday) resHeap[i] = this.getDay(); break;
case "W": // ISO-8601 week number of year, weeks starting on Monday var startOfYear = new Date(this.getFullYear(), 0, 1, 0, 0, 0, 0); var firstDay = startOfYear.getDay() - 1;
case "y": // year, 2 digits; i.e. "99" resHeap[i] = String(this.getFullYear()).substring(2); break;
case "Y": // year, 4 digits; i.e. "1999" resHeap[i] = this.getFullYear(); break;
case "z": // day of the year; i.e. "0" to "365" var firstDay = Date.UTC(this.getFullYear(), 0, 0); var thisDay = Date.UTC(this.getFullYear(), this.getMonth(), this.getDate()); resHeap[i] = Math.floor((thisDay - firstDay) / (1000 * 60 * 60 * 24)); break;
case "Z": // timezone offset in seconds (i.e. "-43200" to "43200"). resHeap[i] = this.getTimezoneOffset() * 60; break;
I am working on a robot project, that is required to create a website to control the robot via serial port.. The website is plainly html, no linking to database is needed...
I have no idea how and what language to use and can JavaScript communicate with serial port? and how?
I'm trying to find the position of an element with respect to the view port area. So, when the user scrolls the page down, I want to know the x and y positions of the element with respect to the viewing (view port) area.
The overall goal is to know exactly where on the element this user clicked.
I am reading the book JQuery Novice To Ninja. I can upload the examples to mozzilla and they work but I down loaded the library to my folder and I wrote out the examples myself and put them in the same folder so I can get the practice and they will not work the code is exactly the same as the book I do not understand.