Help - Search - Member List - Calendar
Full Version: Loading URL contents into a variable
WorkTheWeb Forums > Webmaster Resources > JavaScript Help
Support our Sponsors!
Scott Orsburn
Is there a way to load the contents returned from a URL into a
JavaScript variable? Suppose a user picks an option from a popup list.
I want to pass that choice in a URL to a script on a server that runs a
query on a database. The value is returned from the URL and is
populated in a JavaScript variable. Something like:

function LookupFunc(TestString)
{
TheResult = script.loadValueFrom =
"http://dbserver/LookupScript.php?TheValue=" + TestString;

alert(TheResult);
}

The goal is that I can lookup values "on the fly" rather than trying to
accommodate the choices before hand.


__
Scott Orsburn
Kaomso
www.kaomso.com

I'm not clever enough to think of a cool signature.

JimO
Two questions:
1) Is there a way to keep someone from viewing the source code of a page?

2) Is there a way to keep someone from copying content from a page?

Thanks,
Jim

Eitan
Hello,

I am looking for a collection object in javascript (like dictionary in VB).

Give me some sample code ,please.

Thanks :)

PiedmontBiz
Greetings

I have written an online survey with 110 questions. I use javascript to cycle
thru all the questions which are displayed in an iframe.

I keep track of the question number using a "global" variable.
When testing it, everything works fine until I hit the back button. The iframe
goes to the previous question, but of course, the counter is not decremented.

Example if I am at question # 5 and I hit the back button, I go to #4, but If I
proceed to the next question, the count jumps to #6 rather than 4.

I did this using cookies once- each question represented a new page generated
by Python. This handled the back button problem just fine,

I like the fact that Iframes greatly reduce my bandwidth usage.

Any Ideas or do you need more details.

Below is the Javascript I used. Simple I know. I am learning.

//
<script language="JavaScript">

var response=new Array(111);
var scores =new Array(23);
var rank =new Array(23);
var toprank=new Array(23);
var num=0;
var numtoprank=0;
var list=new Array(23);
var Rnum=new Array(23);

function zeronum()
{
num=0;
}


function rankresponse()
{
var temp=0;

for (n=0;n<22;n++)
{
rank[n]=0;
list[n]=n;
}

for (n=0; n<22;n++)
rank[n] = response[n] + response[n+22] + response[n+44] + response[n+66]
+ response[n+88];


for (n=0; n<22;n++)
{
Rnum[n] = rank[n];
for (j=n+1; j<22;j++)
{
if(rank[j]>Rnum[n])
{
Rnum[n] = rank[j];
rank[j]=rank[n]
rank[n]=temp;
temp=list[j];
list[j]=list[n];
list[n]=temp;
}//end if
} //end for j
}//end for n




}

function aa(start)
{
var s="http://mywebsiteactualurlhere.com/testresults.php4?";

if (num<=108){
num=num+1;
response[num-1]=start;
window.frames.anIframe.location.href
='statements/statement'+num.toString()+'.htm';


}
else {
rankresponse();
//window.frames.anIframe.location.href
='giftresults/results'+toprank.toString()+'.htm';
// document.write("<hr><h1>THe program chose, "
+list[1]+"@"+list[2]+list[3]+"</h1><hr>");

s=s+'g1='+list[0].toString()+'&g2='+list[1].toString()+'&g3='+list[2].toSt
ring();
document.location=s;


}

}
</script>


Allen

kinne
Is it possible to pass a parameter to an external ".js" file?

Kinne

mscir
Keon wrote:
QUOTE
I'm using a picture that the same is as the background.
the iframe is not transparant but you can't see the different between the
background of the iframe and the background of the page.

greeting
Koen

"sleeper" <[Email Removed]> wrote in message
And would you be so kind to share it with the worls
greetz,sleeper

"Keon" <[Email Removed]> schreef in bericht
Hoi
Do someone know how i can make the background of a iframe transparancy? I
already tried it with filter: Alpha(Opacity=50,); but it also make the
text transperancy. do someone know how to do this?
greetings
Koen

http://msdn.microsoft.com/workshop/author/...atingframes.asp

Using Transparency with Inline Floating Frames

Although Internet Explorer has supported transparent elements since
Internet Explorer 4.0, only Internet Explorer 5.5 supports transparent
content with inline floating frames.

The following conditions must be met to define transparent content for
inline floating frames.

* The ALLOWTRANSPARENCY attribute, used with the IFRAME element,
must be set to true.
* In the IFRAME content source document, the background-color or
BGCOLOR attribute of the BODY element must be set to transparent.

Note The BGCOLOR attribute can be applied to the BODY element, but it
is deprecated as of HTML 4.0. It is recommended that you use the
background-color attribute instead.

The following example shows how to apply the background-color attribute
to the IFRAME content source file.

<HTML>
<BODY STYLE="background-color:transparent">
<P>Transparent.
</BODY>
</HTML>

The following example shows how the IFRAME element is written for
transparent content.

<IFRAME NAME="Frame1" SRC="frame.htm" ALLOWTRANSPARENCY="true">
</IFRAME>

Tom Szabo
Hi,
I am wondering if it is possible to send/ submit something to a server and
not to update the page.

Considering a large page, when the user clicks on an item, I like to send a
message to the server but not change the page, so the large amount of code
doesn't have to be retransmitted back to the browser but the database would
be updated.

Is this possible at all?

TIA,

Tom

Daniel
I`m trying to show japanese characters in an alert, like;

alert('実装されていませ');

This doesn't work as shown in this post:
http://groups.google.com/groups?hl=en&lr=&....com%26rnum%3D2

This post implyes that it's possible to use the uXXXX notation
instead. But is this notation using the same codes? Can I transform
this
alert('実装されていませ');

into this?
alert('u23455u35013u12373u12428u12390u12356u12414u12379');

It doesn't seem to work. Does anyone have an idea?

Information
I'm looking for a script that will check a visitors browser.

Now, I only want visitors using Microsoft InterNet Explorer to visit
existing URL and all other browsers will be redirected to another part
of my site.

I've checked a bunch of scripts but you have to identify every darn
browser available. All I want to do is check for any version of
Microsoft InterNet Explorer and redirect all other browsers to another
URL.

Any help would be greatly appreciated.

Thanks!

Sam Hale
Hi guys,

I'm not a javascript expert, infact, i'm not a javascript beginner!
I've been asked to try and find a solution to a problem, that I just
cannot do! I've sat here for two hours with no success what so ever.

http://wmtricur-ande.nlw2k17.userarea.co.u...surix/index.htm

The menu works fine, and looks fantastic. But, when entering the third
tier (click Assurix, and then click News Room), I'm trying to get rid
of the fading from the top right corner effect. (Don't worry about the
positioning and the bg's being different for different levels, still
in brief mode)

Can anyone help ? I think the problem lies in -

function dmxFLG1(){//v1.05
// Copyright 2003, Marja Ribbers (FlevOOware.nl), George Petrov
(DMXzone.com). All rights reserved.
var v1=arguments,v2=v1[0],v3=MM_findObj(v2),v4=document,v5=window;top.LG9=(navigator.userAgent.toLowerCase().indexOf("mac")!=-1);if
(!v3||dmxFLG11(v2)){return;}v3.LG27=v1[1];if (!top.LG15){top.LG15=new
Array();}if (top.LG15[0]==null){top.LG15[0]=new Array();}if
(dmxFLG7(v2,0)==false){top.LG15[0][top.LG15[0].length]=v2;}if
(v3.LG27>0){var v6=v1[3];dmxFLG4(v2,v6);}var v7=v1[2];if (v7==1){if
(v4.layers){v3.captureEvents(Event.MOUSEOUT,Event.MOUSEOVER);}v3.onmouseout=dmxFLG8;v3.onmouseover=dmxFLG9;v3.LG8=false;}v3.LG16=(v2.indexOf("?")>0)?v2.substring(v2.indexOf("?")+1):"";v3.LG13=v1[4];if
(v1.length>19){var v8=(v1.length>22)?v1[22]:null;dmxFLG22(v2,v1[19],v1[20],v1[21],v8);}var
v9=new flvS3(v2);if (v3.LG13==2){v3.LG38=v1[5];v3.LG35=v1[6];v3.LG37=v1[7];v3.LG36=v1[8];dmxFLG5(v3);}else
{if (v3.LG11==null){v3.LG11=v9.x;v3.LG10=v9.y;}}v3.LG12=v9.w;v3.LG14=v9.h;v3.LG30=v1[9];if
(v3.LG30!=0){if ((v3.LG30==1)||(v3.LG30==2)){v3.LG4=v1[10];v3.LG17=v1[11];}if
(v3.LG30==1){dmxFLG14(v2,v1[12],v1[13]);}else if
(v3.LG30==3){v3.LG1=v1[10];v3.LG2=v1[11];}}if
(v1[14]==1){v3.LG32=v1[15]*1000;if (v3.LG2){v3.LG32+=v3.LG2*1000;}else
if (v3.LG4){v3.LG32+=1000;}var
v10="dmxFLG6('"+v2+"')";v3.LG24=setTimeout(v10,v3.LG32);}v3.LG21=v1[16];if
(v3.LG21==2){v3.LG25=v1[17];v3.LG28=v1[18];}else if
(v3.LG21==3){v3.LG22=v1[17];v3.LG23=v1[18];}var
v11=v3.LG11,v12=v3.LG10;if (v3.LG13==1){var
v13=(v3.LG16!="")?eval("parent."+v3.LG16):window,v14=new
flvS6(v13);v11+=v14.x;v12+=v14.y;}var v15=(v4.layers)?v3:v3.style;if
(v3.LG30==1){var v16=v3.LG20,v17=v3.LG19;if (v3.LG13==1){var
v13=(v3.LG16!="")?eval("parent."+v3.LG16):window;var v14=new
flvS6(v13);v16+=v14.x;v17+=v14.y;}flvS8(v3,v16,v17);v15.visibility='visible';dmxFLG15(v2,v11,v12,1);}else
{flvS8(v3,v11,v12);if (v3.LG30==2){dmxFLG16(v2);}else if
(v3.LG30==3){dmxFLG20(v2,v3.LG1,v3.LG2,1);}else
{v15.visibility='visible';v3.LG3=1;}}if
(v3.LG13==2&&!top.LG18){top.LG18=true;if
(v4.getElementById&&v4.createElement){if
(v5.addEventListener){v5.addEventListener("resize",dmxFLG3,true);}else
if (v5.attachEvent){v5.attachEvent("onresize",dmxFLG3);}}else {var
v18=(v5.onresize)?v5.onresize:function (){};v5.onresize=function
(){v18();dmxFLG3();};}}if (v5.onLGShow){onLGShow(v2);}}

This bulk of jargon (to me anyway)

If anyone can even help me in the slightest, i'd be very
apprechiative. Although I know this isn't exactly the easiest of
question / best described question.

Thanks for any help.

Sam.

jonathan
I installed service pack 2. Sometimes I saw a link that link to:
<a href="javascript:popChatWin(0)">

Sometimes I use javascript to redirect website. Service pack 2 block
that.

Sometimes the javascript is not blocked. Sometimes it is. When is it
blocked and when not? Does javascript always blocked under service
pack 2?


PHP Help | Linux Help | Web Hosting | Reseller Hosting | SSL Hosting
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2005 Invision Power Services, Inc.