Jump to content

Shadowing

Members
  • Posts

    222
  • Joined

  • Last visited

Everything posted by Shadowing

  1. i put this below on its own page. and alert doesnt pop up, no firebug errors either $(function(){ politics(); function politics() { grab_alliance_rank( function() { alert("test"); // doesn't pop up }); } function grab_alliance_rank() {}});
  2. alright 'll put all this on a seperate page to test it out hehe
  3. no errors in firebugi clicked on html and looked at the div and it was blank. but idk would i see it there? still though alert("test") doesnt work so activating function grab_alliance_rank never trips the alert
  4. lol dosonesuk. well it would explain alot and all this time i thought you was a coding god when it is really just your OS if I do this alert doesnt even pop up $(function(){ politics(); function politics() { grab_alliance_rank( function(rank) { document.getElementById("alliance_rank").innerHTML=rank; alert("test"); // doesn't pop up }); alert("test"); // does pop up} });
  5. hey guys I dont know what im doing wrong but i cant seem to make the jquery UI progressive bar work. for my understanding all it does is just increases the width of a element i set one css property for progessbarbackground-color:yellow; I would thought it would increase the widght to 37 percent.if all it does is just increase the width maybe i should make this my self from scratch <link rel="stylesheet" type="text/css" href="style/jquery.ui.all.css" /><script type="text/javascript" src="<?php echo LPATH; ?>jquery/jquery.js"></script><script type="text/javascript" src="<?php echo LPATH; ?>jquery/ui_widgets/jui.js"></script><script type="text/javascript" src="<?php echo LPATH; ?>jquery/ui_widgets/ui_widget.js"></script><script type="text/javascript" src="<?php echo LPATH; ?>jquery/ui_widgets/ui_progressbar.js"></script> <script>$(function(){ $( "#progressbar" ).progressbar({ value: 37 }); });</script> </head><body><div class="demo"><div id="progressbar"></div></div>
  6. I had to abandon this even when i almost had it finished. I think it was going to be annoying to players, i think i'll fall back on the show and hide method. Also the main reason i abandon it is cause when i was moving the mouse around it was making it lag and if moved fast enough a dead stop lol. I moved my scripted to a page of its own and there was no lag so I guess a few loops i have running in the game is to much for that being in the game to maybe.
  7. oh nice, yah that fixed it. kewl just learn something really useful there, thanks man
  8. when i call politics(); alert doesnt even pop up
  9. did a little bit of googling, this isn't what I want. that would be real easy to make whats on this link lol http://codecanyon.net/item/jquery-marquee-animation-plugin/full_screen_preview/236431 anyways lol i dont know what i was thinking. I already built what I need almost. The same tool i made to make space ships shoot at each other on my home page www.stargatesystemlords.com lol i can just use that. I'll have to write up something to make it work so i can change the lenght of the sentence though i think not sure.
  10. Im wanting to search for a plug in that makes words move left to right then when they go far enough they dissapear and start again on the left. Not sure what that is called anyone know? thought about just making my ownsomeone probably already made a nice one though. still thinking how i would make it though lol. id almost have to have a span tag around every word
  11. omg dsonesuk lol I think i have to give you more code in how im using it cause im still clueless, then you can see my error and give me a jab in the face. function politics() { // trying to read the rank in this function rank = grab_alliance_rank( function(getrank) { document.getElementById("alliance_rank").innerHTML=getrank; } )alert(rank); } function grab_alliance_rank(rank) { $.ajax({ // grabs the users alliance rank url: "ajax/politics.php?functions=rank", type: 'POST', dataType: 'json', error: function(){ alert("Oops... seems to be a problem retrieving data. function alliance rank") }, success: function(response) { var rank = (response.rank); } }); } <div id="alliance_rank"></div>
  12. thanks for the reply well i notcie i had several buttons sharing the same class name that im not using for the click. The class was on a td tag.Getting rid of that seem to of fixed it I think. I dont think i have any code using that class as a click plus i dont see why it would trip the same click more then once, if anything it would just click all the tags with that class. hmm maybe i have a ending tr tag off or something or td tag and so it trips it more then once that way since its reading. will look at that
  13. Thanks for the reply as always dsonesuk im a little confused lol this below is how im grabing the rank grab_alliance_rank(function(getrank){document.getElementById("puthere").innerHTML=getrank;}) how am I storing the rank? dont i have to put something here to store it success: function(response) { var rank = (response.rank); // store rank some how here } and dont I need a return on grab_alliance_rank function function grab_alliance_rank(rank) { $.ajax({ // grabs the users alliance rank url: "ajax/politics.php?functions=rank", type: 'POST', dataType: 'json', error: function(){ alert("Oops... seems to be a problem retrieving data. function alliance rank") }, success: function(response) { var rank = (response.rank); // store rank some how here } }); return rank;} so I guess this some how inserts the agrument?document.getelementbyid works as a print or echo sort of speak? function(getrank){document.getElementById("puthere").innerHTML=getrank;}
  14. Hey guys I ran into this problem where it appears that jquery seems to be triping more then once when reading clicks. Am i suppose to be doing something to prevent this? Its a button linked to an ajax script and its meant to be clicked more then once. I notice one click can be up to 6 clicks some times. but usually twice. $("input#advance").live('click' ,function(event) { event.preventDefault(); buildings("advance"); });
  15. Hey guys this is driving me crazy i dont know why i cant simply return a value like i would in a php functionI can never read out side ajax brackets, the script isnt failing eitherrank alerts "0" on success says rank is undefined function grab_alliance_rank() { $.ajax({ url: "ajax/politics.php?functions=rank", type: 'POST', dataType: 'json', error: function(){ alert("Oops... seems to be a problem retrieving data. function alliance rank") }, success: function(response) { var rank = (response.rank); alert(rank); // this works here } });return rank ; }
  16. Hey guys kind of a wierd issue im having with using fadeTo i have this code being triggered with a clickI notice if I keep clicking on it fast it doesnt reset. like i would of thought. what happends is first click starts optacity at 40 then fades outthen 2nd fast click doesnt reset doesnt start at 40 but does replace the information so its like i cant assign anymore animation until the fadeOut has finished? $('div#display_sector').fadeTo(0,0); // reset to 0 $('div#display_sector').fadeTo(0,.4); // start at 40 $('div#display_sector').html(session_x+" - "+session_y); // replace div with information $('div#display_sector').fadeOut(2000); // fade out
  17. yah the wiki on it saysThe game uses pure Javascript Web technology, and is not based on Adobe Flash, unlike many other browser-based games. i know for sure its not java cause it doesnt load java when loading the game. http://en.wikipedia.org/wiki/Lord_of_Ultima so im thinking they using a back ground image then putting a transparent CSS list on top of that or something. if you look closely at the menu that is highlighted at the top you will see that even the smalle edge of the menu is highlighted also
  18. Hey guys I was wondering how they did the menu's on this game. I dont think they are using CSS or javascript on this. They must be using a ton of background images?
  19. Oh nice thanks guys lol. that was really simple. idk why i didnt think it worked like that, idk the input closing tag was a accident lol not sure why i did that in the example.
  20. thanks for the reply yah im wanting it so that when the users clicks on the <input> it activates it. unless there is another way of doing a statement for that?
  21. no problem lets say you I have a textarea "<textarea></textarea>"when people type into the text area and hit "enter" it goes to the next line. The browser does this by default. I have a chat box that uses <input type=text'></input>so im using this below to make it when users hit "enter" it runs the post_message function which submimts their chat message $(document.documentElement).keydown(function(e){ if (e.keyCode== 13) { post_message(); return false; } }); the problem is with the code above active when a user types in the <textarea></textarea> hitting enter no longer takes them to the next line because the key enter is set only to run the post_message function so i need to beable to disable it and reenable it
  22. Thanks for the reply CodeName. nah i want it to work in the chat box also. the problem is when i get it working in the chat box. it messes up when people hit enter to go to the next line inside a textarea. so i need to figure out how to shut it off then turn it back on again
  23. Hey guys im currently using keydown on the key "Enter" for people to type in a chat box i made. The problem im having is it effects all my textarea boxes too. like email etc.... Its preventing hitting enter and going to the next line cause my entire site is 100 percent ajax. So i need help figuring out how to disable and enable this. anyone have any ideasi was thinking of making it so that it enables when someone clicks on the input to type in the chat box then i'll disable it when they open up any windows/div's. $(document.documentElement).keydown(function(e){ if (e.keyCode == 13) { post_message(); return false; } });
  24. oh htmlspecialchars isnt working cause im not using double quotes on the out side on the value of the attr so after doing some reading about htmlspecialchars apparently there is a 2nd parameter lol to escape the both quotes data='".htmlspecialchars($subject,ENT_QUOTES)."'
  25. wierd i just tried this and its not working hmmif i store can'###### comes out as can $return = "<a href='' data='".htmlspecialchars($subject)."'>$subject</a>"; I'm storing it in data then grabing it with attr with jquery and then sending it back to a php page usingjquery ajax on the data field.
×
×
  • Create New...