I was looking in the firebug debugger and noticed that my main .js file was somehow being called twice, but I don't see where. There are dozens of files involved in this particular problem, so I think the best way to go about solving it is to test - in run time - if my js file is already in place on the page, do nothing - otherwise call it. This is pseudo that I have monkeying around with but it's not working.
Code:
function checkFile() {
var fileExist = new fileExist();
fileExist.onLoad = isPresent;
[code]....
I thought this would work, perhaps it's because of an argument I need to pass in to checkFile(ZYX) but not sure.
I have a form that puts all the inputs into cookies, then submits it's data the cookies. I am doing this because i need to be able to check for already existing names, so a person gets an alert if they try to register twice. The cookies and submitting all work fine, but i am having trouble correctly writing the code to check the cookies for the name the user is attempting to submit.
here is what I have:
See if the entered name already exists
function checkName () { var cookieString = decodeURIComponent(document.cookie); var userName = cookieString.substr(cookieString.indexOf("name=")";");
I inherited a site that has jscript and html content. The site frame (top and left nav) are controlled by the jscript file. Most all of the content that is displayed when links or topics are selected is placed in the center of the page. I need to put some scrolling text in one of the top frame blocks, (the section that is java script file).
function buildMenus(){ var headerString = ""; var leftnavString = ""; var footerString = "";
[code]....
I have a couple of jscripts that do the scrolling I want, I just need to know how to insert it in the above section.
I have a site with a news pages and I'd like the navigation to include a blinking 'NEW!' when that page has been updated within the last three days.
It works fine for the one page (if you're on the news page, it works great) but I can't figure out how to check the time/date stamp on a file other than the one currently loaded ...
So I'm trying to create a custom file uploader which will display the name of the file selected, but since I can't seem to figure out how to do this I've settled for checking to see if a file has been selected, but I'm still having trouble with it.Here's what I have...
However the value doesn't change after the file has been selected. Could someone tell me a means of modifying this so that it will properly display once the file has been uploaded? Do I need to have some sort of constant refresh on the Javascript to check to see if the value has been changed?
I have seen many Javascripts on Internet that checks the extension of the file before uploading. But all these scripts checks the extension when the Submit button is pressed. I want to check the file extension as soon as the file is selected. The script should delete the selected file from the type=file box and display an error message (when a file with the wrong extension is selected).
I got a file upload form (in asp), besides of checking if the extension is .jpg .bmp etc, how do i check if the file really is an image? so pple wont be able to change an exe file to jpg and upload it right away.
In client side, we can check if some image exists using onerror. I wish the same behavior to check files used in object tag (in client cache, not in file system), like swf, wmv and wma, etc.
I have a file that generates web galleries in Adobe Lightroom. They are generated depending on which files are selected and the metadata in those files.
Basically it is a series of pages of thumbnails called index.html index_1.html index_2.html etc.
Then a set of pages for each individual image.
An example can be seen here: [url](the page navigation links are not great, but I have addressed that, they're at the bottom >> )
Currently if a user clicks on a photo there is a 'return to thumbnails button at the top, but this always takes them to /index.html
So the user could be at a picture after browsing to /index_39.html and still get returned to /index
Is there any way I can use history.go to find the last instance of index.html Or index_x.html (where x is any number) and take them back to that instead?
Is there a way using javascript to have it check if a file exists on the server? I'm trying to check for a file on my server without having to refresh the open webpage. If this can't be done with javascript, do you know which webpage languange can execute this?
I'm try to set up a webpge that will play a live flash video on the left-hand side(got that part working) and display one slide of a presentation(jpg) to the right of the video. I would like to be able to control when the slide image changes by having some js check a text file on my server. The text file could contain something as simple as "Slide1.jpg". I will manipulate the text file with some code I've already written. Is there some simple js code I can put in my page that will cause it to check the text file every 5 seconds, and if the content of the file has changed, to refresh the image on the page with the new image? I'm try to get away from the "clicking" sound that is caused by doing a simple refresh of an Iframe.
I have some links that open a window, when this window is open various php processes are carried out and it sets serveral global variables. The problem i am having is users, you can't just tell them to have one instance of the window open you have to enfore that rule and i am having a problem doing that.
i have this code:
function launch(newURL, newName, newFeatures, orgName) { var remote = open(newURL, newName, newFeatures); if (remote.opener == null) remote.opener = window; remote.opener.name = orgName; return remote; }
and this function is called upon by another function Code:
I'm trying to use a variable that is passed into a function to to dynamically name an instance of an Object(). I've created a Timer() Object that seems to work just fine... the problem is I can't figure out how to pass in an instance name into setTimer() to create a new instance of Timer() object?? My ultimate goal is to have multiple instances of the Timer() Object running at once. While the code below works it only allows me to create 1 instance of the Timer() Object with the name of tmp. Code:
I am new to Javascript and am working with Ajax. I am building a content manager for my site, and I have an instance of CKEditor. I was wondering what the javascript would be to get the value of the textarea. Normally with a textarea I use formname.elementname.value. When I use that with the CKEditor I get a null value.
Code: <script type="text/javascript"> var monthtext=['January','February','March','April','May','June','July','August','September','October','November','December'];
[Code]...
Only the second calendar is taking effect. All the dropdowns in calendar1 is empty. Please help me.
I have the following code running in FireFox 1.5 (a remote XUL application):
var req = new XMLHttpRequest(); // execution will block until request is completed // third param set to false makes request synchronous req.open(strMethod, uriTarget, false); if(strMethod == "POST") {
By the time it gets to req.send() (at the bottom) all the callback functions like req.onerror still have values of null. I've verified this using the Venkman debugger with req as a watch variable.
the code is clearly assigning functions to those callback function objects. Any idea why they are all turning up null?
I have a javascript object which dynamically generates a table adding, deleting and moving rows as the user clicks on buttons or links. Problem is when I generate a table row and add the javascript method call to my class, I have to put the object instance name variable of the class in order for it to be called from the onclick=function(). This is seriously limiting, but I'm stuck for a way round it. Heres a edited of the code so you get the idea....
Instantiating the object :-
var dtl = new DynamicTableList("table1", $ {myObject.allFieldsAsJavaScriptArray}, true, true, true);
My javascript class DynamicTableList, note the dtl javascript object instance variable being referred to in the addRow function. How can I avoid this???
if (showDelete) { var cell2 = document.createElement('TD'); var inp2 = document.createElement('IMG'); / ************************************************** ***********************************************/ inp2.onclick=function(){dtl.delRow(this);} // Have to specify dtc!!!!!!!! / ************************************************** ***********************************************/ inp2.title='Delete' inp2.alt='Delete' inp2.src='images/delete.gif' cell2.appendChild(inp2); row.appendChild(cell2); }
...
tbody.appendChild(row);
this.processRows(); };
this.moveRow = function(node, vector) { }; }
Obviously the code dtl.delRow(this); is being dynamically generated, but how do I replace the dtl instance name with something that'll work whatever the user of this class calls the instance of it!
I have a client, let's call them "BuyNow." They would like for every instance of their name throughout the copy of their site to be stylized like "BuyNow," where the second half of their name is in bold.
I'd really hate to spend a day adding <strong> tags to all the copy. Is there a good way to do this using jQuery?
I need to change the background-image (or possibly background-position) property of each new instance of a div with a particular class. I will have a set of images to choose from, or could create a sprite with all of the images.
I am wanting to add a style (bold and blue for example) to every instance of a word or words on my website. Is this possible with jQuery? And how would I write it?