-
Posts
104 -
Joined
-
Last visited
Never
Everything posted by thecard
-
Blimey, that is a mess! Just please make sure you copied the WHOLE document from the old server. I'll try to have a look through it in the mean time.
-
Passing variables across iframes different domains. Can it be done?
thecard replied to thecard's topic in Javascript Help
Using GET vars. -
There is a security blocker in browsers now a days which makes passing vars from an iframe to the page which it is embedded in hard! Is there a way round it? I have searched google a lot, but I just found a lot of answers that I don't understand about fragment identifiers. I know a lot of people are looking into this at the moment because of the cross domain capabilities which this allows. Thanks for any help! ???
-
Is there a way of doing this without using a spider?
-
So how do you exactly make a php file look like a javascript file (using MOD_rewrite). So does the php get executed on the browser side?
-
And just using the query strings...I'm not sure that would work.
-
I understand that, but if its ajax, how does it work across domains?
-
There's nothing wrong with the actual function.
-
I have been studying the google remote scripts for some time. I know that the google ad script must: 1) Find out the domain name (easy in js). 2) Then select information from a database according the domain name. 3) Then output the information retrieved from the database. But how does the script do this? Surely you would need a server side script to do this, not just a .js file! agh!
-
Sorry -> it is called in the php file and the arguments are passed to it from the php.
-
The HTML (MAIN DOCUMENT): <html> <head> <script type="text/javascript" src="js.js"> </script> </head> <body onLoad="doit();"> <a id="inner1"></a> <a id="inner2"></a> <a id="inner3"></a> <a id="inner4"></a> <a id="inner5"></a> <a id="inner6"></a> <a id="inner7"></a> <a id="inner8"></a> <a id="inner9"></a> <a id="inner10"></a> <a id="inner11"></a> <a id="inner12"></a> <a id="inner13"></a> <a id="inner14"></a> <a id="inner15"></a> <a id="inner16"></a> <a id="inner17"></a> <a id="inner18"></a> <a id="inner19"></a> <a id="inner20"></a> </body> </html> The PHP file (inside the iframe): I am not going to give you the exact code because it doesn't matter. The php does these actions mainly: Links to the javascript. Connects to a mysql database. GETS the $_GET['dom']; SELECTS 20 pieces of data from the database and passes them to the javascript in the dostuff function (which you can see in the javascript): The Javascript: function doit() { var mf = document.createElement("<iframe>"); mf.src = "http://mydomain.com/frame.php?dom=" + window.location; mf.width = "300px"; mf.height = "300px"; mf.frameborder="0"; mf.marginheight="0"; mf.marginwidth="0"; mf.id="mando"; document.body.appendChild(mf); } function dostuff(nav1,nav2,nav3,nav4,nav5,nav6,nav7,nav8,nav9,nav10,nav11,nav12,nav13,nav14,nav15,nav16,nav17,nav18,nav19,nav20) { var n1 = nav1; var n2 = nav2; var n3 = nav3; var n4 = nav4; var n5 = nav5; var n6 = nav6; var n7 = nav7; var n8 = nav8; var n9 = nav9; var n10 = nav10; var n11 = nav11; var n12 = nav12; var n13 = nav13; var n14 = nav14; var n15 = nav15; var n16 = nav16; var n17 = nav17; var n18 = nav18; var n19 = nav19; var n20 = nav20; document.getElementById("inner1").innerHTML = n1; } If you are correct the last line should put the variable n1 into the <a> tag with the id="inner1". This line does not write anything to the document. I know that vars n1 -> n20 do exist also because I have done lots of "alert tests" with them.
-
I know that, but the javascript is connected to 2 documents: The main page, and the Iframe. The Iframe calls the function in the javascript, and this function must write to a div tag in THE MAIN DOCUMENT.
-
Please help.
-
Your Welcome.
-
if (empty($_POST['username'])){ echo $message; } You echo an error message for each one of these "little tests" but don't do anything else. Your code just keeps on processing until it is inserted into the database. You must change each one of those to something like this: if (empty($_POST['username'])){ echo $message; exit(); } Try this: http://devzone.zend.com/node/view/id/627
-
No, I need it to be in the main script. Sorry. Thanks for all the help. I hope some others try to help out!
-
How do you mean retrieve?
-
Well, my situation is rather complicated: Both documents share the same javascript page, but the framed document (B) has to pass variables to the js by query strings (in the url) there are 20 variables. I need to collect these variables in the js and output them onto document A. Thanks for your time. I really dunno how to do this.
-
Thanks. Me being a noob at js I'm not sure either: It sounds like it shd work, but should it be the file name then .write?
-
I'm currently learning from "Javascript and AJAX Visual Quick Start Guide" By Tom Negrino and Dori Smith. Its a great book, though sometimes I find it has a lack of depth.
-
I have 2 documents linked to a javascript. Document "B" is in a Frame on Document "A". Since both are linked to the javascript, how do I choose which document to output on? e.g. document.write("HELLO"); Can I choose to write that to either document?
-
[SOLVED] Something Wrong with setting scr with getelementbyid
thecard replied to thecard's topic in Javascript Help
Found the error: Just a typo: Instead of src, I put scr. Dam. Here's the correct script: <html> <head> <title>User's Nice HTML Page</title> <script type="text/javascript"> function doit(dom) { document.getElementById("boa").src = "frame.php?dom=" + dom; } </script> </head> <body onload="doit(window.location)"> <iframe name="iframe1" id="boa" align="top" height="100" width="400" hspace="10" vspace="10"> </iframe> </body> </html> -
[SOLVED] Something Wrong with setting scr with getelementbyid
thecard replied to thecard's topic in Javascript Help
Didn't work! this is really annoying! -
[SOLVED] Something Wrong with setting scr with getelementbyid
thecard replied to thecard's topic in Javascript Help
That didn't work.. -
HERE is the full code: <html> <title>User's Nice HTML Page</title> </head> <body> <script type="text/javascript"> window.onload = doit(window.location); function doit(dom) { document.getElementById("boa").scr = "frame.php?dom=" + dom; } </script> <iframe name="iframe1" id="boa" align="top" height="100" width="400" hspace="10" vspace="10"> </iframe> </body> </html> Frame.php: <? $dom = $_GET['dom']; echo"DOMAIN IS $dom"; ?> All that is outputted is a blank iframe (frame.php is not even loaded into it)! Why doesn't frame.php get loaded into the iframe? :'(