it seems to be a problem if I need to access data() of the elements from another window, like for example $(anyElement,window.opener.document).data() which returns null when in fact there is some data actually stored. I heard that data is stored in the $.cache, which is window-related, so that's understandable, but how can I work around that?
Certain plugins that use $.data no longer work correctly because of that. E.g., I can't use linkselectmethods on linkselects located in the window.opener.document. Again, is there any workaround?
Goal: From window A, I want to manipulate the DOM of window B, where window B is the result of calling window.open(). My attempts are shown below, but Window B is never updated. winRef = window.open("","Window B"); Try 1: $(winRef).find("body").append("<div id=container>mr container</div>"); Try 2: $(winRef).find("body").html("<div id=container>mr container</div>"); Try 3: $(winRef.document.body).append("<div id=container>mr container</ div>"); Try 4: $(winRef.document.body).html("<div id=container>mr container</div>"); The jQuery Core doc [URL] claims that it can wrap a window object. Browser is FF2.0
I have 3 Jquery tabs on the form. Each tab contain same HTML Tables, I want to access the data in a Cell of a table in an active tab on the button click
in normal Case I use
var x=document.getElementById("searchResultTable").rows[10].cells; referenceNo=x[2].innerHTML;// get the value in the Cell alert( "x[2].innerHTML);
if i use this Code i get only the First Table data .All the Tabs Contains Same Table with Same Id and Name
When retrieving JSON data I'm able to access individual elements using the $.each() function and iterate over them. However, how would I access just one element by its location and not by name? (i.e. data(0) not data.ID).
So I'm currently working on a ASP.NET Webforms site and I've run in to a small problem. On my .cs file I have the following Webmethod
[WebMethod] public static string IsJobEditable(int jobid){ try{ string isEditable = "false"; JobsBLL jbl = new JobsBLL(); int jobStatusId = jbl.GetJobStatusId(jobid); //If the jobs is either waiting or being edited it is okay to edit it if(jobStatusId == Convert.ToInt32(ConstantsUtil.JobStatus.Waiting) || jobStatusId == Convert.ToInt32(ConstantsUtil.JobStatus.Edit)){ isEditable = "true"; }return isEditable; }catch (Exception ex){ throw ex; }}
This function in this case will ALWAYS return TRUE as a string. On Aspx page I have the following $(function () { $.ajax({ type: "POST", url: "Coordination.aspx/IsJobEditable", data: "{jobid:" + jobid + "}", contentType: "application/json; charset=utf-8", dataType: "text", success: function (result) { alert(result);
//This is written out in the alert {"d":"true"} I want this in a variable as a string so I can do a check on it before I do some other actions. The format is not a String so I cannot split on it to retrieve the "true" part. }, error: function (err, result) { alert(err); } });});
As you can see in the comments the value I get back in the Callback method is in to me a weird format. The type is unknown and I need this value to be able to proceed with my entire method surrounding the small portion of the Javascript. Where to access the result variable / data as a var or anything else that will let me put it into a var (as a string).
I've been using some code to verify form data quite happily, but i've recently changed the way my form is structured, and I can't get it to work now.
Originally :
The form is called "form1", and I have selects called "PORTA", "PORTB" ... etc...
I then had javascript that accessed these selects as below, and it worked fine.
ind = document.form1.PORTD.selectedIndex; val = document.form1.PORTD.options[ind].value; dev = document.form1.PORTD.options[ind].text;
My form is now autogenerated, and form data is stored to file, so I now use an associative array for thte form elements (so that I can loop through them easily), The form elements names are now :
McuCfg[PORTA], McuCfg{PORTB} and so on
Now, I modified the javascript so that it now uses the McuCfg[] associative array :
ind = document.form1.McuCfg[PORTD].selectedIndex; val = document.form1.McuCfg[PORTD].options[ind].value; dev = document.form1.McuCfg[PORTD].options[ind].text;
When the script runs, I get the error
"document.form1.McuCfg.PORTD is null or not an object"
I have used the same notation that i know works for the "options" array although that's not an associative array.
I am working on a project using HTML and javascript to allow the user to choose a vehicle from a drop down menu, then load a new page showing some information about this vehicle. The information is stored in an Excel file. I posted regarding this issue a while back and got an excellent response from Old Pedant about using ActiveX - which has thus far worked perfectly. My initial condition was that I would only be using IE7+. However, my next idea was to be able to use it on an IPad (which I unfortunately do not own yet, making any kind of testing difficult) which I am fairly certain ActiveX won't work on. So, I was looking for any other method which would be similar.
Important note: this will not use the internet at all, all of these files will be available locally. There is a lot of material on running queries to servers, but I didn't think that would really apply here. It seems pretty clear that JS has difficulty accessing files client side (which I understand why completely), but I was hoping to find something that worked for the gray zone I'm currently working in since I'm not using servers at all.
I know that this is not really the intended use of HTML/JS, but I was hoping that by writing it as an HTML file, it'd be accessible to anyone with a browser. Some of my target computers have odd limitations (such as not being to download .exe files).The code I based my original off of is shown below:
<script type="text/javascript"> var conn = new ActiveXObject("ADODB.Connection") conn.Open ( 'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:fullpath oMyExcel.xls;Extended Properties="Excel 8.0;HDR=Yes;IMEX=1";)'; var sql = "SELECT * FROM [nameOfSheet$]"; var rs = conn.execute( sql )
I have a frame in which there are 2 IFrames., both being loaded from the same domain. One IFrame is loaded from http://test1.xyz.com and the other IFrame is loaded from https://test1.xyz.com/test
I am getting an error while accessing data in the HTTP IFRAME from the HTTPS IFRAME.
Is it possible at all to access the data in the other IFrame, when the protocol is different?
I'm trying to accessing the Parent window fom a sub window previously opened using window.open.I'm using firebug to t yand debug, and it shows that this DOM entry exists..window.opener.location.href.But trying to access it gives "window opener is null" error.I've tried all these, and get the various errors tagged on the end...
<script language="JavaScript"> //alert(opener.location); // = opener is null //alert(opener.location.href); // = opener is null[code]......
I'm not sure if this is possible, but I'm looking for a way to access another IE browser window using JavaScript (assuming the two browser windows are running in the same instance).
The purpose of this task is so that if a user hits ctrl+n in IE, the new window is "aware" of the other instance.
I have got a following problem with using javascript:
I have a HTML page with pictures' thumbnails. After clicking on any thumbnail, I would like to open a new window with the original size picture. In the main window with thumbnails, I have got following important stuff: Code:
I am currently creating which will allow the user to upload their own pictures. For this I am opening a new pop up window where the user can select the file they wish and then upload it (similar to ebay's picture upload). The pop up works fine and so does the file upload however I am having trouble transferring any data from the pop up window back to the parent window. I have been investigating the opener method but cannot seem to get it to work. Below is some simple code that I've been trying to get to work.
first page. <form name="loadpic" id="loadpic" action="createPost.php" method="post"> <br /> <br /> Testing transfer between pages... <input type="button" value="open pop up" onclick="window.open('popup.php','pop up box','width=400,height=200')" />
I am working on a PHP-script and need javascript to set the value of a hidden field in a form. This field happens to be an entry in an array data[3] according to my example. How can I do this?
Below is listet two PHP-pages: one that doesn't work (to my dismay), and another that does work, but do not use an array entry in the hidden field. Code:
Is it possible to pass information back from a popup window?
I am looking to open a popup from our internet site to our web based mainframe app (HATS). I would like to send some strings from this popup page back to text fields in the calling page to populate a form. Does this sound possible?
I have an application with a button that opens up another website. That website requires credentials. I'm currently using window.open to get the url open and passing a variable to the end of the URL, but when I have searched for a good way to get the credentials passed by using post and can't seem to find a solution. I tried xmlhttprequest, but the limitation of cross-domains is huge because I will have external clients connecting to the database and don't think that asking them to lower the security settings in IE would be a good way to do it. All I need is the ability to click on the button, pass the username and password and have the url open to desired page. I posted the code of the application in another thread, but all I'm getting are just views.
I have a script that opens up another window and a task gets executed, all of that is fine, but is there anyway that the parent window (the window that gets open) can pass data to the window that opened it? (I pretty much want to enable a button on that page)
Having a little trouble of knowing where to start. I'm trying to take user inputted data options from a popup window form and put it in an existing form behind the current window.
From the user input I want to be able to take each of the text fields and format them into a table on the resumeProcessor.html. I however am unable to figure out how to call the values into my code.