|
Manfred R. Bihy wrote: there is a space after content
Corrected
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Description:
Select Element with Id like txtUserContent with Class Name is txtUserImage
Interpretation:
(#txtUserContent .txtUserImage)
Legend:
# getting element by ID
. getting element by ClassName
Thanks,
Imdadhusen
sunaSaRa Imdadhusen
+91 99095 44184
|
|
|
|
|
Hi every body,
ANy one tried implementing search functionality in Ext.ux.maximgb.treegrid.GridPanel .?
i m using treegrid i need to implement search functionality..
as i m new to ext js dont know how to proceed.
any one know how to implement.?
if any one have tried it then plz post code or the plugin (as grid-filter plugin I have).
Thanks
|
|
|
|
|
I have a control like this:
<input type="file" value="Open File" id="openfile"/>
and I need the full path for the selected file. In IE, I can get this, but in Firefox it returns only the filename part. Is there a way to get the full path?
I know somebody gonna say I don't need it to upload a file, but I'm not uploading a file to a remote server and I really do need the local path. My page is passing the local path to a locally running self-hosted WCF server that then passes the path to another application with will actually load the file. Without the full path, the application will treat the path as relative to whatever its current directory is, which obviously fails most of the time.
|
|
|
|
|
|
Thanks for the reply, but I think that is trying to do the opposite of what I'm trying to do. Your links are looking to remove the path from IE so that you have only the filename. I want to do the opposite, get the path in Firefox.
|
|
|
|
|
Hi everybody,
I develop a website with c# langage and Javascrip. It is opened with IE navigator well but in FireFox, most pages are not opened. How can I make my JS code compatible with Firefox navigator?
ty
|
|
|
|
|
Some of the stuff that interacts with the DOM, window, document and events are handled differently from browser to browser. You could build browser switches into your code to handle each situation differently for each browser you intend to support. You could just as well resort to a crossbrowser compatible javascript framework like jQuery[^] for instance which is my favorite.
On the following site you can find a list of the more or less well known Javascript Crossbrowser Frameworks/Libraries[^].
Best Regards,
—MRB
"With sufficient thrust, pigs fly just fine."
Ross Callon, The Twelve Networking Truths, RFC1925
modified on Thursday, August 4, 2011 11:05 AM
|
|
|
|
|
Hi Manfred,
I work with the EXT JS Framework, but some instructions differ from browser to browser.So if i develop a version of my application for each browser, that will be sooooo expensive in the two sides time and code.
ty
|
|
|
|
|
Hi Pierre,
what instructions are you talking about? Surely it must be something you're doing in plain javascript and not the ExtJS framework. Please give and example and try to explain what difficulties you are experiencing in regard to browser dependant coding.
À bientôt !
"With sufficient thrust, pigs fly just fine."
Ross Callon, The Twelve Networking Truths, RFC1925
|
|
|
|
|
Manfred R. Bihy is 100% correct and your issue is one of the reasons why these frameworks are so popular, they handle the browser specific behaviours so we can focus on coding the application/webpage.
Chris J
www.redash.org
|
|
|
|
|
I've made a <form> with an <input> for a new category. Once the category is entered I need to enter an unknown number of sub-items.
Can anyone help me with a javascript that enables me to click a [+] button that generates a new (html) input line like this: [+] Next item : <input name="sub-item" value="sub_item[]" />.
The onClick [+] button should at least have one parameter that enables me to change the input type into e.g. select
|
|
|
|
|
|
Thanks a lot. It was quite helpful
|
|
|
|
|
I have a desktop app that acts as a server and I'm trying to figure out how to correct connect to it from a webpage using JavaScript.
For example, I have this:
var url = 'http://localhost:8003/Service/Rest';
function MyFunction1()
{
var client = new XMLHttpRequest();
client.open("GET", url + "/MyFunction1", false);
client.setRequestHeader("Content-Type","text/plain");
client.send();
if (client.status == 200)
alert("Success!");
else
alert("Failure!");
}
Then I have a simple button on my webpage that calls the function in it's onclick.
In Firefox, I can see from my server app that the function gets called on the server, but I never see the success or failure messages in the browser. Opening up the web console in Firefox, I can see the following error:
[15:50:50.693] uncaught exception: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE)" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: file:///D:/AC%20SOAP%20test.html :: MyFunction1:: line 18" data: no]
(Note: line 18 is the client.send() line.)
Any idea what might be happening here?
In IE, I first get a warning about ActiveX components when loading the page (not sure why) and after that it seems to work (including the success pop-up) for a couple of clicks until the server seemed to stop responding although the success pop-up continued to appear.
Any help here would be appreciated.
[Side note: I started off with a SOAP server and tried to use SoapClient, but I couldn't get that to work at all. I got the same NS_ERROR_FAILURE but without the server doing anything, so I gave up on it and decided to try implementing REST as well as SOAP on my server]
|
|
|
|
|
So, I think I figured out the IE problem, it's caching the result rather than calling the method again. I fixed it using the method on the mozilla website here:
https://developer.mozilla.org/En/XMLHttpRequest/Using_XMLHttpRequest#Bypassing_the_cache[^]
By adding a timestamp to the request. Ironically, this works in IE, but now it doesn't work at all in Firefox. Firefox doesn't call the method in my server at all and still gives the same error. 
|
|
|
|
|
Any ideas? From some further investigation, I'm wondering if this is a cross-domain problem. But the server app seems to respond to the request coming from my webpage, I would have assumed it would have rejected the call outright if that was the problem?
|
|
|
|
|
Just an update. I did eventually get this working, but I tried a lot of things and I'm not entirely sure which one eventually fixed the problem. I ended up using jQuery and JSONP on the Javascript side, which took some amount of swearing and cursing at before it worked (the tutorials for jQuery on the jQuery website are useless), and on the server side I upgraded my project to .NET 4.0 (from 3.5) so I could add the CrossDomainScriptAccessEnabled property to my WebHttpBinding in the app.config (not sure if it was strictly necessary, but I'm too tired to try removing it to see if it'll still work without it).
Eventually it worked, I'm still not sure if cross domain was the issue or not.
|
|
|
|
|
Hi I have a repeater in my Jquery modal and onclick of row this is how i am creating an object with each column value for that row.
<ItemTemplate>
<tr id='Tr1'
onclick= 'javascript:Repeater_selectRow(this, {"myObj":{"id":"<%#DataBinder.Eval(Container.DataItem, "Id")%>","name" :"<%#DataBinder.Eval(Container.DataItem, "Name")%>","details":"<%#DataBinder.Eval(Container.DataItem, "details")%>"}},true);'>
<td bgcolor="" valign="top"><%#DataBinder.Eval(Container.DataItem, "Id")%></td>
<td bgcolor="" valign="top"><%#DataBinder.Eval(Container.DataItem, "Name")%></td>
<td bgcolor="" valign="top"><%#DataBinder.Eval(Container.DataItem, "details")%></td>
</tr>
</ItemTemplate>
This as I understanhd will give me a myObj json object on the click of row with row value.
but how could i use this object to assign the values to say a textbox or value?
also i need to acess this myObj object when i click a button on my modal to close it and pass this object back to main window.
|
|
|
|
|
no answers ?!
|
|
|
|
|
Im trying to fill a dropdown list that is inside of a usercontrol, the name of my user controls is _ucExclusion which has the property ClientType, ClientID. How can I fill the ddl ClienType with the response.d object?
<script language="javascript" type="text/javascript">
$(document).ready(function () {
$.ajax({
type: "POST",
url: "Configuration.aspx/GetClients",
data: {},
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (response) {
alert("Worked");
I tried this but is not working
$('#<%=_ucExclusion%>').attr("ClientType").val(response.d) ;
$('<%=_ucExclusion.ClientID %>').append(response.d.toString());
},
failure: function (msg) {
alert("New Exclusion saving failed");
}
});
});
</script>
|
|
|
|
|
The code you provided has two small issues. The first is the setting of _ucExclusion.ClientID . You are forgetting the '#' sign in the selector. So it should be:
$('#<%=_ucExclusion.ClientID %>').append(response);
The second is in the entire handling inside the function of success. According the the jQuery docs the $.ajax method returns a string to the success method containing the data of the response.
|
|
|
|
|
I see nothing wrong with the success handler. The data being returned will be in the d property. Perhaps I'm missing something, would you care to elaborate?
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
I missed something in your code, namely dataType: "json" . So you would be getting a json object by the $.ajax method rather then a string.
Are you receiving the alert for 'worked', if not you might want to add the error: function(){...} method, I don't seem to be able to find the 'failure' option in the $.ajax documentation, so this is probably never being called even if it fails.
|
|
|
|
|
Hello to all ...
I am very basic on this of javascript, so someone could help me how to resolve this issue.
I have a javascript (HTML internal), which fetches and executes a file in another web address...
but I do not want it to do that, i want this script to execute is function directly from my local disk (file location).
Here is the script;
<html><br />
<head></head><br />
<body><br />
<div style="WIDTH: 984px; HEIGHT: 443px" ><pre><script type="text/javascript"><br />
var previewConfigs = [{<br />
type: 'flash',<br />
preview_url: "http://myflashtest.com/files/9083/preview.swf",<br />
base: "http://myflashtest/files/9083/"<br />
}];<br />
</script></pre><span id="large_item_preview"><br />
<object style="visibility: visible; Z-INDEX: 0; WIDTH: 590px; HEIGHT: 300px; TOP: -51px; LEFT: -27px; " id="large_item_preview_container" data="srcs-ff/preview.swf"></object> </span><br />
<script type="text/javascript" src="srcs-ff/jquery.js"><br />
</script><br />
<script type="text/javascript" src="srcs-ff/preview.js"><br />
</script><br />
<script type="text/javascript"><br />
if (typeof(previewConfigs) !== 'undefined') {<br />
for (var i = 0; i < previewConfigs.length; i += 1) {<br />
var preview = new ItemPreview(previewConfigs[i]);<br />
preview.display();<br />
};<br />
};<br />
</script><br />
<script type="text/javascript"><br />
$(document).ready(function() {<br />
$("tr[data-accessor=source]").click();<br />
});<br />
</script><br />
</div><br />
</body><br />
</html>
What I want is to change this part;;
preview_url: "http://myflashtest.com/files/9083/preview.swf",
base: "http://myflashtest/files/9083/"
|
|
|
|