Jump to content

need major help. PLEASE READ!!


addtrain

Recommended Posts

ok...

i think that this is probably very advanced, since even a college computer admin couldn't get how you can do this.

there is tons of pages out there that do this. if you wanna see an example, go to either http://joeyxchaos.com/train/1.php

or http://addsx.com/, and click add to friends. once the window comes up, close that popup window. it should go to myspace.com.

then, look at what has happened to the "Not Added" text. it has changed to "added!".

i took a look at both pages scripts, and style sheets, but i couldnt find out where the changing of the text happens! i did "view source" on the part BEFORE i clicked "add me!", and the part AFTER i clicked it, and the code is BASIC HTML, yet it changed after i clicked it. the college computer admin says that whoever makes these, that the code simply changes. i want my site to be able to do the same thing. how do i do this? is it possible (it must be since i have proof)??-

seamus stumped ???

 

Link to comment
Share on other sites

Well, at first reading of your post I thought the sites might be using AJAX (a combination of Javascript and a sever-side platform such as PHP). But after looking at your "examples" it seems they aren't using AJAX at, just a simple javascript even to determine that you have clicked the link.

 

Here si a simple example:

 

<html>
<head>

<script type="text/javascript">

oldTextAry = new Array();

function changeText (fieldObj, newTexStr) {
  fieldObj.innerHTML = newTexStr;
}

</script>

</head>

<body>

<a href="http://www.yahoo.com" target="_blank" onclick="changeText(this,'Added');" id="text1link">Add Me</a>

</body>
</html>

Link to comment
Share on other sites

  • 3 weeks later...

also, i took a look at the addsx.com code, and it looks like this, there is no advanced java or anything in there code, simply a text change. the question is, how????

here is the code they used with the add me images:

<form action="" method="post" target="_self">
                <input type="hidden" name="a" value="[213293954]" /><input type="image" src="http://i23.tinypic.com/sytksx.gif" onclick="window.open('http://collect.myspace.com/index.cfm?fuseaction=invite.addfriend_verify&apos;amp;apos;friendID=213293954')" name="submit" />
            </form>
            <span style="font-weight: bold; color: #009999">Not added =(</span>

Link to comment
Share on other sites

I'm really not sure what mrore you want or what you are trying to accomplish. The code I provided was a viable solution. Do you have anyidea what you are planning to do with this information on the back end?

 

If you don't know what extension to give the file, then you need to learn more about tyhe technology and how it is used. PHP is used to create HTML. If you were to name the file as PHP it will work fine as long as it is run on a server with PHP. Or, you could simple name it as an HTML file.

 

Take a look at this (save as an html file):

<html>
<head>
<style>
img { border: 0px; }

.added {
  color:#22dd66;
  font-size:14pt;
  font-weight:bold;
}

.notadded {
  color:#44ccff;
  font-size:14pt;
  font-weight:bold;
}

</style>

<script type="text/javascript">

oldTextAry = new Array();

function changeText (textFieldID) {
  textFieldObj = document.getElementById(textFieldID);
  textFieldObj.className = 'added';
  textFieldObj.innerHTML = 'Added ';
}

</script>

</head>

<body>
<a href="#" onclick="changeText('text1')"><img src="http://i18.tinypic.com/6akphsz.gif"></a>
<br><div id="text1" class="notadded">Not added =(</div>

</body>
</html>

Link to comment
Share on other sites

what i am trying to do is make (when you click on the image), a seperate window (target="_blank") opens up, and at the same time the text changes...once ALL OF THE IMAGES HAVE BEEN CLICKED ON, an input below changes from disabled, to abled.

Link to comment
Share on other sites

This particular forum is for PHP. If you have any further questions/isues you should raise it in the Javascript forum. Also, most of these forums are intended for people to get help with their code, not to have someone write it all for them.

 

<html>
<head>
<style>
img { border: 0px; }

.added {
  color:#22dd66;
  font-size:14pt;
  font-weight:bold;
}

.notadded {
  color:#44ccff;
  font-size:14pt;
  font-weight:bold;
}

</style>

<script type="text/javascript">

oldTextAry = new Array();

function changeText (textFieldID) {
  textFieldObj = document.getElementById(textFieldID);
  textFieldObj.className = 'added';
  textFieldObj.innerHTML = 'Added ';

  divsArray = document.getElementsByTagName('div');

  for (i=0; i<divsArray.length; i++) {
    if(divsArray[i].className=='notadded') { return false; }
  }

  document.getElementById('submit').disabled = false;
  return true;

}

</script>

</head>

<body>
<a href="http://www.yahoo.com" target="_blank" onclick="changeText('text1')"><img src="http://i18.tinypic.com/6akphsz.gif"></a>
<br><div id="text1" class="notadded">Not added =(</div>

<a href="http://www.google.com" target="_blank" onclick="changeText('text2')"><img src="http://i18.tinypic.com/6akphsz.gif"></a>
<br><div id="text2" class="notadded">Not added =(</div>

<a href="http://www.phpfreaks.net" target="_blank" onclick="changeText('text3')"><img src="http://i18.tinypic.com/6akphsz.gif"></a>
<br><div id="text3" class="notadded">Not added =(</div>

<button type="submit" id="submit" disabled="disabled">Click here to join!</button>

</body>
</html>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.