I have a web based application for my company. We use Coldfusion, I
wanted to see if I could use Javascript to make the page a bit more
dynamic.
Right now I use the command:
<cfhttp URL="http://server:port" method="get" Timeout="20" charset="UTF-8">
<cfhttpparam name="var" type="CGI" value="command I send">
this connects to an application on another server listening on the
provided port for a request. When it sees the command a parser
reads the command and formats an XML file that is returned to the web
page. I can parse the XML and use it to fill out the page.
I've read about using "ActiveXObject(Microsoft.XMLHTTP)" and
onreadystatechange to dynamically update a web page.
I would like to send the Coldfusion command, or it's Javascript equivalent
to update the page. Say if you need to change an address,
you could submit the change and just the address would be updated on the
page, so it isn't necessary for the remote server to return the entire
account information again.
I have date fields on a form which is generated by a Coldfusion custom tag (another piece of code). I want to change something else on the form when the user changes the date. But, how do I generate an onChange() event on this field (since I only have the call to the custom tag in this form)?
I am trying to use tiny_mce with coldfusion application in order to convert the content in the editor to image. I am getting following error. Tried a lot but couldn't fix it.b.
I'm using jQuery $.ajax or $.getJSON on document.ready to access data from the server through coldfusion remote cfc files.
My url looks something like this for the main page [url]
When i go to a new page i.e. [url]
The ajax functions are called but are not collecting new data (only in IE). IE caches the response and wont give me a new one unless I refresh the page, which I don't want to do.
Here's an example of a function I call. I've also tried $.getJSON with no success.
function getGrains() {
I've looked into ways to make sure IE wont cache files. Some of the popular suggestions are:
Add a random parameter to the url: I've done this:
Change get requests to posts: Done (see function)
Also, jQuery's cache:false doesn't work.
I'm not sure I can use the meta tags or header cache-control functions because it's not caching my html page, it just caches these HTTPRequests from within my javascript file, and they're not loading html, just json objects.
OK so I've been searching for a week now for an example of pagination of data using jquery, ColdFusion and SQL server. I'm finding tons of examples using PHP and MySQL. Have any of you successfully got pagination working with Fusion and SQL Server? I am trying to run a report that could end up having thousands of results that I would like to paginate using jquery. Most of the pagination plugins though rely on you returning ALL of the results to the client first whether in JSON, XML or just straight to the browser as a table and then it paginates them. So if there are thousands of results this is not optimal. I'd like to try and get something working where as it paginates it goes to the database using Fusion and just grabs the next X records to display.
I have a cfm file that has a url that directs the page to another cfm pageI would like on clicking the url to call a coldfusion function befor going to the next pageexampleI have a component mycomponent
I'm working on some code and am running into brick walls. I'm trying to write out Javascript with Javascript and I've read the clj Meta FAQ and didn't see the answer, read many similar posts (with no luck though), and searched through the IRT.ORG Faqs (www.irt.org/script/script.htm).
The Javascript is designed to open an popup window and then inside that window call another script which will resize that window. There may be another way around this but the reason I tried this approach initially was that I wanted to call the onload handler in the popup window to resize the image only after the image had completely loaded. I've had some code in the primary Javascript file (showimage.js) before that works if the image has been cached but on the first load, it doesn't resize properly which tells me it is probably because it is trying to resize the window based on the image size but it isn't completely known at that point. So I removed that code and tried placing the resizing code in the second Javascript file (resizewindow.js). BTW I've tried other code to open a popup image and automatically size it ie Q1443 at irt.org but that doesn't do exactly what we need.
Even if there is another way to do this with one file, I still want to figure out why this isn't working in case I run into it in the future.
I thought what I would need to do to use document.writeln to write Javascript would be to escape any special characters and to break apart the script tag ie
document.writeln('</SCRIPT>');
would become
document.writeln('</SCR' + 'IPT>');
I have a HTML page and 2 Javascript files. All files are in the same directory and have permissions set correctly.
Here are the 3 files (keep in mind wordwrap has jacked up the formatting):
index.html ---------- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Test</title> <SCRIPT type="text/javascript" LANGUAGE="JavaScript1.1" SRC="showimage.js"> </SCRIPT> </head>
<body> Click the house<BR> <A ONCLICK="newWindow1('house1.jpg','Nice House')"><IMG SRC="house1thumb.jpg"></A> </body> </html>
showimage.js ------------ function newWindow1(pic,sitename) {
resizewindow.js --------------- function resizewindow() { // Do resizing here. // Right now this isn't being executed alert("resizing window"); }
Can anyone provide some pointers as to why this javascript is failing? I'm using IE6 on Win2k and when I click on the image to open the popup window, it does open the window but it is white with no content and the system immediately goes from about 4% CPU usage to 100% and consistently stays there until I kill that window with the task manager.
Attached is a simple HTML file that adds and delete rows. In the add row function I set an attribute "onClick" this triggers the testMessage() function. When I try this in Firefox it works just fine however on IE it just refuses to work.
What is interseting is the ROW that already exists has a similar 'onClick' event which works when the page is loaded, but subsequent "row" additions to the table to not work in IE. Code:
I'm getting errors in Firefox everytime I try to run this frame resize code, but it works fine in IE. I can't seem to figure out what the problem is with it.
The error is: Error: theFrame has no properties Line: 8
The line that the javascript console is showing an error for is in italics.
I'm already past the basics of Javascript, and i need something that takes me to the other level and teaches me the new technologies and cool stuff (drag&drop, AJAX, OOP in javascript, maybe XUL...etc). So far i found these two books:
1. Sitepoint's "The JavaScript Anthology: 101 Essential Tips, Tricks & Hacks". 2. Worx's "Professional JavaScript for Web Developers (Wrox Professional Guides)"
Both seems to cover very insteresting topics, but i can only buy one of them. So which one do you suggest?
and by the way, i've read the sample chapter 5 of Sitepoint's book, and it seems like the author(s) just put the solutions/codes there and let you figure them out on your own. Is this how the rest of the chapters are?
This is a question about defensive web browsing. Ocassionally I run into a page whose JavaScript does something that I find obnoxious. I would like to turn off JavaScript only for that page (instead of disabling it globally). It would be cool if there were some way to do this through a "bookmarkable" JavaScript snippet using the javascript: pseudoprotocol. Does anyone know any trick to do any of this?
I am looking for a method to extract the links embedded within the Javascript in a web page: an ActiveX component, or example code in C++/Pascal/etc. I am looking for a general solution, not one tailored to a particular page/script.
Hopefully, the problem can be solved without recreating a complete Javascript interpreter. Any ideas?
I have some javascript that I have written into the <body> section and it works great. But I would like to make it into a javascript function and define the function in the <head> section. Then in the <body> section write a small bit of javascript that would call the function() object. Code:
I would like to know how to write javascript such that, a part of it isnt considered as script, & rather as HTML. Code:
Ok, the layer div can be written using document.write. But, Google ad itself is a javascript isnt it. How can it be written into this? How does this work?
Ok so, this is my purpose: - to be able to load asynchronously (via AJAX) some javascript ads (like google's or adbrite) so as to make them be loaded in the background, then update the page after the ads have loaded via innerHTML
Why? -Because 90% of the time in my newer sites, javascript ads are the major offender in terms of speed of page rendering
My problem: Via ajax, I can call a php file that retrieves some javascript and outputs it, XMLhttprequest returns those javascript lines, but they don't render in the page, since they miss the whole page loading, and are apparently not parsed For example, let's say I call a php file via ajax, and it returns the output into a variable named "text" containing "document.write('hello')" if I use xxx.innerHTML=text, nothing happens
My 1st solution: Passing those javascript lines to eval() [like eval(text) ], but this produces a second problem, that I couldn't solve (probably because of my lack of knowledge in javascipt): if I eval the code, it deletes my current page and renders a new one for example, if I parse a document.write, my page disappears, and a new one is rendered with the document.write text
What I want is basically to make that "document.write" appear inside a div in my page, adding to the content (and not overwriting the whole page), much like what happens when using innerHTML
Is this even possible? How would you go about it? I tried xxx.innerHTML=eval(outputfromphpfile) but it overwrites my whole page...
Just a quickie: is it possible to place javascript within javascript? The following is the code I am using to create a pop-up for a picture gallery. I would like to place a banner from a banner exchange in bold under each photo. When I use the code below I get an error message:
Basically, on one of my sites I'm running adsense and today I added Chitika. The problem is, I can't run those type of ads through my banner advertising program.
The banner advertising program calls the banners/HTML from code like this:
And using that program I'm able to either choose a banner or HTML I want to display when that code above is used. It displays HTML ok... but when I try to run an ad of either adsense or chitika nothing displays on the page. The code that would be called is:
So... it looks like I can't have javascript call another javascript to display on a page. My question is then... how can I edit the above to make it work or how can I work around this problem? I'd really want this to work with Chitika and not so much with adsense... but it appears both Chitika and Adsense use similar javascript code.
How can I use NSS (Network Security Services) from Mozilla/Firefox Javascript?
I'm trying to sign some data using a private key in Javascript. I know the crypto module should allow that with the signText method, but some of the crypto methods seem to be broken, raising Not Implemented exceptions.
I know this subject has been well discussed, but I haven't found exactly what I'm looking for in the archives, or if it's possible.
I need to call a cgi (actually, mod_perl) script, but not on every page hit - preferably just on the first. I'm dealing with a static site and what I'd like to do is use javascript to read a cookie, and if the cookie is found, I'll use the value from the cookie to display some html.
However, if the cookie isn't found, then I need to call a perl script that will do some processing, set a cookie, but somehow I need to get the value back - the same value that is used to set the cookie - without reloading the page. I know I can use javascript src="/path/to/myscript" and have the Perl script write javascript (setting my variable which I can use later), but then I couldn't use the "if" logic to see if I actually need to call the Perl script as the client side javascript will be overridden by the "src" attribute...