|
Hi
I think you would be able to load images according to value selection from dropdown. you should have to define an Array which have loaded all the images during page load.
Then after you can find the index of selected item from dropdown and you will get the item based on index from an Array.
I hope this will help you to resolve the issue.
Please do let me know, if you want something more...
Thanks,
Imdadhusen
sunaSaRa Imdadhusen
+91 99095 44184
+91 02767 284464
|
|
|
|
|
"All of the images" includes 250 GB of data, with somewhere around 1,000,000 images. Therefore, I cannot load all of them into an array (which is what I would normally do), nor can I predict which of the million images will be viewed by the client. I guess I am hoping to find a way to generate 4-16 simultaneous http requests and display the data as I receive it for all images, instead of downloading one at a time. At least then the client would get a blurry approximation of each image right away, instead of waiting until all prior images are completely finished downloading. Any additional help is appreciated,
Sounds like somebody's got a case of the Mondays
-Jeff
|
|
|
|
|
Hi, could you please tell what is Ajax. what is javascript?
I am using ASP.Net for developing web application and some one suggest to learn Ajax and Java Script. could you please give me what ara thoese. what is the difference between Ajax and javascript?
|
|
|
|
|
You probably need much more information than can be added to these forums. I would suggest trying a Google search for both subjects and read some of the information you find. You could also look here[^] for more information related to ASP.Net.
It's time for a new signature.
|
|
|
|
|
|
Hi,
Can any one please suggest me how can I set p3p header in HTML page. I have an application (say domain is www.abc.com) that will load my page "mypage.html" in Iframe( with domain xyz.com). My page is HTML page , in my HTML page I am invoking some other html page say "ExternalPage.html" page with domain PQR.com , Here i have to pass cookies from HTML page (mypage.html) to external page "ExternalPage.html". Since both are different domain ,I am unable to set cookie . I am using below code in mypage.html to allow cookies to set but it is not working . Can anyone please suggest on this.
<meta http-equiv="P3P" content='CP="CNT"'/>
Thanks,
Salmon.
|
|
|
|
|
there is a button in my page that causes a javascript to be invoked. when the POST returns, it causes some HTML elements to be removed. This is because the page's Render is called again and my HTML elements controls is rendered by a javascript framework I am using.
so my solution is to trap 2 events
1. when the button is clicked, i want to set aside this node
2. when the post back returns, i want to reattach this node to where it was.
Can anyone suggest how to do this?
Many thanks!
----------------------------------------------------------
Lorem ipsum dolor sit amet.
|
|
|
|
|
Is it necessary to postback your form? Can it be done via ajax? Otherwise the only way is to persist the node somewhere, viewstate, session, etc. and reattach during rendering.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
yes it is doing it by ajax control toolkit and would require quite a bit of rework to make it to have a server side controller instead of a postback to the page.
i'm thinking of persisting it as a cached DOM object in the browser. Because it's containing DOM element stays, i can clone the removed DOM element (which is a panel) and reattach it to the same node.
my 2 issues are:
1) cloning a DOM object, there doesn't seem to be a raw javascript code that handles. the framework i am using doesn't have it either.
2) trapping the event that fires when the postback response is rendered to the DOM. (adding a listener to the element that causes the postback in the first place is the easy part).
thanks for spending some time thinking about my problem.
----------------------------------------------------------
Lorem ipsum dolor sit amet.
|
|
|
|
|
1) JQuery .clone()[^]
2) AJAX toolkit only gets you so far. Handling the ajax calls yourself gives you the flexibility to do this.
ajaxComplete()[^]
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Hi,
Working in Acrobat 9.0 forms (not LiveCycle). Have a push button ("MKTGlaunch") to launch a new form from the currently open form. I want to make a check box on the 'parent' form to indicate that the button has been pushed. (i.e. If the button is pushed, program puts a check in the box.)
What is the best way to indicate the action of the button? On the "Mouse Up" there’s already a JS to tell the program to launch the new form, using the "Open a Web Link."
I tried adding a "Run JavaScript" onto another Mouse Up, but nothing happens. I've also tried putting it on the "Mouse Down," but that doesn't work.
But perhaps I'm using the wrong syntax? I'm very much a beginner. This is what I'm using for the Mouse Up/Down:
var MKT = this.getField("MKTGlaunch");
this.getField(MKT.isBoxChecked(0) == true);
Can you give me a push in the right direction?
Is there a better way to do this?
|
|
|
|
|
I don't really understand what the Acrobat 9.0 forms has to do with anything, but if you are just attempting to check a box on the mouseup event, try:
function mouseUpFunc() {
document.getElementById('MKTGlaunch').checked = true;
} And the associated HTML contains something like:
<input type="checkbox" id="MKTGlaunch" />
<input type="button" onclick="mouseUpFunc();" /> Hope this helps!
Sounds like somebody's got a case of the Mondays
-Jeff
|
|
|
|
|
hi guys. i have loop which needs to attach event on some elements. event must fire function and pass value from within loop. so here is problem... when loop is over all events fire same argument that is passed by ref not value at that time.
<a href="#">link 1</a>
<a href="#">link 2</a>
<a href="#">link 3</a>
<script type="text/javascript">
var anchorNiz = document.getElementsByTagName("a");
for(var i=0;i<anchorNiz.length;i++){
var anchor = anchorNiz[i];
anchor.attachEvent("onmouseover",function(){alert(i)});
//this line does same thing, different value
//anchor.attachEvent("onmouseover",function(){alert(anchor)});
}
//the idea is to set links to fire ordinal number, but all are fireing '3'
</script>
|
|
|
|
|
you will get 0, 1 and 2
<a href="#">link 1</a>
<a href="#">link 2</a>
<a href="#">link 3</a>
<script type="text/javascript">
var anchorNiz = document.getElementsByTagName("a");
for(var i=0;i<anchorNiz.length;i++){
var anchor = anchorNiz[i];
anchor.attachEvent("onmouseover",(function(){
var arg = arguments[0];
return function(){
alert(arg);}})(i))
}
</script> also attachevent omly works in IE
modified on Tuesday, September 14, 2010 2:24 PM
|
|
|
|
|
thx. very interesting solution....
|
|
|
|
|
I want to use jQuery and jTemplates to display information returned via a webservice.
The code I am trying is:
function InsertAfter(RowID, json) {
var thisTable = document.getElementById("myTable");
var newRow = thisTable.insertRow(GetRowIndex(RowID));
newCell = newRow.insertCell(0);
newCell.colspan = '3';
newID = RowID + 'Results';
newCell.id = newID;
var template = $('#jTemplateResultsRow').html();
var item = $('#' + newID);
item.setTemplate(template);
item.processTemplate(json);
}
Everything goes fine til I get to the item.setTemplate(template); . Then I get a Microsoft JScript runtime error: Object doesn't support this property or method error.
I have double checked that both the jQuery and jTemplates libraries are loaded and that there are no conflicting javascript templates/frameworks/etc that are referenced.
Both the template and item get set to valid values.
Does anyone have any ideas or suggestions that could help?
---------------------------------------------------------------------
The issue was with the web service returning a nested json string.
All now works
modified on Wednesday, September 22, 2010 12:33 AM
|
|
|
|
|
You need to debug the javascript to see that template and item are both valid items. Depending on the development environment you are using, I tend to just put a debugger; statement in to force the app into the script debugger.
|
|
|
|
|
Thanks Pete,
I fixed this problem a couple of days ago, but forgot to update here.
The issue was mostly that the web service was returning a string with json inside json.
When I figured that out, it all just worked!
|
|
|
|
|
RCoate wrote: When I figured that out, it all just worked!
Good job
|
|
|
|
|
Hi,
Please verify item object which is set or not like set the debug point on following line
item.setTemplate(template);
and see whether item has any value if not then the problem is in following line
var item = $('#' + newID);
Thanks
sunaSaRa Imdadhusen
+91 99095 44184
+91 02767 284464
|
|
|
|
|
what is the best way to protect your javascript IP from being snatched and used without your permission? do you obfuscate, encrypt/decrypt your client side javascript?
thanks!
----------------------------------------------------------
Lorem ipsum dolor sit amet.
|
|
|
|
|
Obfuscate the client side scripting.
Here is an example site for doing just that;
http://www.javascriptobfuscator.com/[^]
I ran some code through and here is the example input and output;
function save_options() {
var currentID = localStorage["memberID"];
var newID = textMemberID.value;
if (!(currentID == newID)) {
localStorage["memberID"] = newID;
if (localStorage["memberID"] == newID) {
save_status.innerHTML = "MemberID: " + localStorage["memberID"] + " saved to local storage.";
setTimeout(function () { save_status.innerHTML = ""; }, 1000);
var newRep = new Array();
for (i = 0; i < 9; i++) {
newRep[i] = "0";
}
setNewRepDetail(newRep);
clearTable();
reload_Page();
}
else
{ save_status.innerHTML = "Error saving MemberID to localStorage."; }
}
else {
save_status.innerHTML = "MemberID: has not changed.";
setTimeout(function () { save_status.innerHTML = ""; }, 1000);
}
}
Output;
var _0x9c0d=["\x6D\x65\x6D\x62\x65\x72\x49\x44","\x76\x61\x6C\x75\x65","\x69\x6E\x6E\x65\x72\x48\x54\x4D\x4C","\x4D\x65\x6D\x62\x65\x72\x49\x44\x3A\x20","\x20\x73\x61\x76\x65\x64\x20\x74\x6F\x20\x6C\x6F\x63\x61\x6C\x20\x73\x74\x6F\x72\x61\x67\x65\x2E","","\x30","\x45\x72\x72\x6F\x72\x20\x73\x61\x76\x69\x6E\x67\x20\x4D\x65\x6D\x62\x65\x72\x49\x44\x20\x74\x6F\x20\x6C\x6F\x63\x61\x6C\x53\x74\x6F\x72\x61\x67\x65\x2E","\x4D\x65\x6D\x62\x65\x72\x49\x44\x3A\x20\x68\x61\x73\x20\x6E\x6F\x74\x20\x63\x68\x61\x6E\x67\x65\x64\x2E"];function save_options(){var _0xa035x2=localStorage[_0x9c0d[0]];var _0xa035x3=textMemberID[_0x9c0d[1]];if(!(_0xa035x2==_0xa035x3)){localStorage[_0x9c0d[0]]=_0xa035x3;if(localStorage[_0x9c0d[0]]==_0xa035x3){save_status[_0x9c0d[2]]=_0x9c0d[3]+localStorage[_0x9c0d[0]]+_0x9c0d[4];setTimeout(function (){save_status[_0x9c0d[2]]=_0x9c0d[5];} ,1000);var _0xa035x4= new Array();for(i=0;i<9;i++){_0xa035x4[i]=_0x9c0d[6];} ;setNewRepDetail(_0xa035x4);clearTable();reload_Page();} else {save_status[_0x9c0d[2]]=_0x9c0d[7];} ;} else {save_status[_0x9c0d[2]]=_0x9c0d[8];setTimeout(function (){save_status[_0x9c0d[2]]=_0x9c0d[5];} ,1000);} ;} ;
|
|
|
|
|
Yeah - and anyone can go to sites such as this[^] , or google elsewhere, and de-obfuscate it again.
It might be good for compression purposes, but you'd be an idiot to try hiding aything really imprtant in it, and a fool if you think your IP will be protected because of it.
Short answer tot eh OP's question is: you can't, so don't bother. The longer one is: why do you want to, really? Is there anything in your code that is so mind-blowing, and hasn't been done before, that you just have to stop anyone else from seeing it? Or learning from it...
|
|
|
|
|
Obfuscation is only good for deterring the casual code browser. I totally accept that.
|
|
|
|
|
Here is the code....it works fine on mozilla but on IE clearInterval doesn't work,,...
<br />
<html><br />
<head><br />
<style type="text/css"><br />
.imgf{width:300px; height:250px;}<br />
#img2{z-index:1000;}<br />
</style><br />
<script language="javascript"><br />
window.onload=inItAll;<br />
var j=0;<br />
var N=2;<br />
function inItAll()<br />
{<br />
document.getElementById("img1").onclick=click;<br />
}<br />
<br />
function click()<br />
{<br />
if(navigator.appName=="Netscape")<br />
{<br />
j=0.9;<br />
setInterval("fadeN()",40);<br />
<br />
}<br />
else<br />
{<br />
j=90;<br />
var fI = setInterval("fadeI()",40);<br />
}<br />
<br />
}<br />
<br />
function fadeN()<br />
{<br />
j=j-0.1<br />
<br />
if(j>0.4)<br />
{ <br />
<br />
document.getElementById("img1").style.opacity= j;<br />
}<br />
else<br />
{<br />
j=0.4;<br />
window.clearInterval();<br />
<br />
document.getElementById("img1").src = "images/"+2+".jpg";<br />
<br />
setInterval("showN()",40);<br />
<br />
} <br />
<br />
}<br />
<br />
function showN()<br />
{<br />
<br />
if(j<1)<br />
{<br />
document.getElementById("img1").style.opacity= j;<br />
j=0.1 + j;<br />
<br />
}<br />
else<br />
{<br />
window.clearInterval();<br />
document.getElementById("img1").style.opacity= 1;<br />
<br />
}<br />
}<br />
<br />
function fadeI()<br />
{<br />
j=j-10<br />
<br />
if(j>40)<br />
{ <br />
document.getElementById("img1").style.filter ="alpha(opacity="+j+")";<br />
<br />
}<br />
else<br />
{<br />
j=40;<br />
window.clearInterval(fI);<br />
<br />
document.getElementById("img1").src = "images/2.jpg";<br />
<br />
var sI = setInterval("showI()",40);<br />
} <br />
<br />
}<br />
<br />
function showI()<br />
{<br />
<br />
if(j<100)<br />
{<br />
document.getElementById("img1").style.filter ="alpha(opacity="+j+")";<br />
j=10 + j;<br />
<br />
}<br />
else<br />
{<br />
document.getElementById("img1").style.filter ="alpha(opacity="+100+")";<br />
window.clearInterval(sI);<br />
<br />
}<br />
}<br />
<br />
</script><br />
</head><br />
<body><br />
<center><br />
<br/><br />
<br/><br />
<div id="div1"><br />
<img src="images/1.jpg" class="imgf" id="img1"/><br />
</div> <br />
</center><br />
</body><br />
</html><br />
it gives unwanted flicks on IE coz clearInterval did not work.....
|
|
|
|