I have a javascript variable containing the return value from a call to showModalDialog(...)
var rval = showModalDialog(...)
I can display the contents of rval using alert or in an iframe, so I know it isn't null, but I want to save it to a mysql database using php.
I am looking for a way to troubleshoot css rendering problems. Is there a way to find the calculated styles for any object? I would love to be able to mouse over an element and see all the styles that are causing the element to be where it is, and look the way it does. The elements must "know" this information. Cross browser would be great, but we mainly deal with intranet apps based on IE. Code:
I am running my website using Weblogic, so the path is something like http://<myip>:<port>/<servername>/
On JSP pages I can use <%=request.getContextPath()%to get the root path of the site, ie that specified above. How can I get the same using Javascript?
For example, something like <a href='/home'>..</awill not work as that would point to http://<myip>:<port>/home and needs to point to http://<myip>:<port>/<servername>/home
I need to access the CGI Variables or HTTP Headers in a request. Can I do that in JavaScript? Specifically I need to access the CGI variable remote_user.
By the way, I know someone will comment, by "does not work, I mean on the load of the page, the alert is not displayed, nor are any errors. Thanks for any help you can offer.
i want to do (multiple) file upload(s) and display a progress bar. with firefox and safari it is no problem at all. only IE makes some problems.
my script is based on ajax-uploader, which can be found at www.srmiles.com/freestuff/ajax_file_uploader/ . you can do multiple file uploads. each upload will have it's own "form"-tag, so that each file is uploaded for its own. could be a good solution if there are "big" uploads.
so here is what i do:
i have a html-page in which several forms with file-input fields are generated. when i now hit the "one" submit button at the bottom of the page a javascript function upload() starts it will iterate through all forms (id='frmUpload_xx'), will get the filename, start a ajax request for the progress-bar function and do a form.submit().
if the first form/file is uploaded, a settimeout('upload()', 1000); is called and the next form will be processed. all form's have an target="uploaddiv", where uploaddiv is a invisible iframe. so the output of the upload script is put in this div. output should only be a "OK" at the end. no usefull output no info no nothing.
firefox and safari are working as expected, only IE stops after the first file is uploaded. i get an javascript error saying "zugriff verweigert/access denied" on object line x... this is the place where i call "form.submit()".
this is the upload-function:
function upload() { if (uploads.length>0) { form = document.getElementById('frmUpload_'+uploads[0]); if (form["filename"].value == ""){ alert("Please Choose a file to upload."); } else { filename = form["filename"].value; if (filename.lastIndexOf("")>0) { filename = filename.substring(filename.lastIndexOf("") +1,filename.length); } else if (filename.lastIndexOf("/")>0) { filename = filename.substring(filename.lastIndexOf("/") +1,filename.length); } makeRequest("upload_progress.php?sid="+sid +"&filename="+filename,progress); form.submit(); } } }
the strange thing is, that filename is filled correct, that means the object "form" is found and exisits. the first iteration is working, only the second ends with an error.
think it have something to do with redirecting the output of the upload-script in an iframe. after that IE can't access form - at least IE is not allowed to submit the form as i can access a form field (filename). i worked on that the last two days and haven't found a solution...
The following javascript code generates an "Access denied" error at the indicated line.
This sample should allow the user to click "Browse" and choose a file. Once the user has selected a file the form is automatically submitted. I'm trying to avoid having seperate browse and submit actions.
Can someone explain why I'm getting the error and how I can accomplish this task? Code:
just came across this in a book for browser javascript on/off detection:
Code: <noscript> <img src="monitor.php?scriptoff=true" /> </noscript> just wondering if browsers when js is off will ever access any <script type="text/javascript" src="file.js"></script>
files? i mean wouldn't it be better not to bother with the noscript thing and just be aware of if file.js is accessed? or do some browsers access the file.js even when js is off?
I am quite new to javascript. I tried searching for this question, couldn't find it. I want to access my url bar by running the script so that i can type a new url at runtime. How do i access it and change it. I don't want to move to a new url until and unless user hits the enter key. I only want to type it.
i have div that will contain numerous other div (products in a shopping cart), say up 50.of these contained divs, i need to access every 5th div begging with 1, so it'd be div # 1, 6, 11, 16, 21 etc. and then use jQuery to Add Class to these divs.can someone point me in the right direction on how to do this?
And in a javascript (client side), i want to access to the dom model of the div : i wan't to be able to use selectnodes on "myDiv" : be able to do something like that :
var myDiv = document.GetElementById("myDiv"); var xmlDoc = myDiv.implementation ; // to obtain dom of mydiv ?! var nodeList = xmlDoc.selectNodes("hr") ;
is it possible with "microsoft internet explorer" ? (it works on gecko based browsers)
I have been trying to find some kind of authentication method or script (PHP/perl/javascript or other) to achieve the following, with no luck.
Say there are 100 files at a site. A person can choose which file to download from a list, and to do so has to enter a code or password. When a valid code or password is used they are redirected to a page with a direct link to download the file.
Once that code or password has been used to download that one file (and the same code/password can be used to access any one of the 100 files), it is then expired/deleted/made invalid and can't be used again to download any other file.
I have a variable, divs, which contains the DIV's and divs[x] contains the actual DIV I need.
What is the best (or most robust) way to access the inner textarea - because I want to add some text to the textarea field. I know how to add the text but want to know best way to access the textarea.
have made a homepage with nvu and works good but want to restrict access to all pages except the main page. i want everyone that tries to access a subpage directly to be redirected to the mainpage.
is there any simple way to achieve that ? must be in html or javascript.
It would appear that it is not possible to retrieve CSS properties such as min-width if they have been set from a class. However, I don't want to have to style everything directly with the style attribute whenever I need these properties. Is there a reliable method of getting these properties as applied to element from a CSS class?
How can I access class name without using id. I have following div tag: <div class="aa bb cc"> </div> Their are three classes if I access class then which one will be access.