JavaScript - Pulling Ntid
Hello, everyone. I'm not much of a programmer, but I have been tasked with something that's stumping not only me, but my whole dev team as well. We need to find a way to pull a user's NT ID (Windows log on), and store it in a variable for use later on, and also to watermark the screen on HTML pages in an eLearning course. I have no idea how to do this and I can't seem to find anyone who has encountered a need for this. Any suggestions?
Similar TutorialsI tried to rework a short script to pull info from an iframe instead of the basic page it's sitting on, and I got confused. It's not working. Here's what I've got: Code: <script type="text/javascript" language="JavaScript"> function find_div_class() { var divCollection = document.getElementById('iframeId'); var innerDoc = iframe.contentDocument || iframe.contentWindow.document; for (var i=0; i<divCollection.length; i++) { if(innerDoc[i].getAttribute("class") == "list-journal-entry-wrapper") { findMeText = divCollection[i].innerHTML; alert(findMeText); } } } </script> Press the button to find the divs with class "iframeId".<br /> <input type="button" onfocus="this.blur()" value="iframeId" onclick="javascript:find_div_class();return false;""/> I tried another way too, but still nothing: Code: <script type="text/javascript" language="JavaScript"> function find_div_class() { var divCollection = document.getElementById('iframeId'); var innerDoc = iframe.contentDocument || iframe.contentWindow.document; var info = document.getElementById("list-journal-entry-wrapper"); alert(list-journal-entry-wrapper); } } } </script> I am creating a template generator page that generates a webpage based on what I fill in for certain elements like image name, img src, book title, book author, etc. and these values are sent to me in an excel document which right now I just open and copy and paste everything from the excel document into the form fields for each section. So for example the client sends over a list of book titles they want featured on the page this week and they include author name, author link, book name, book url, img src, etc. and I just copy those new fields into my template and then click generate and the updated HTML code is there for me to copy. This part works totally fine but in the interest of saving time copying upwards of 100 fields from an Excel file into my template, is there a way I can select the excel file (stored locally) on my page with a "browse" directory form and then have a button that runs SQL queries on my Excel document to pull these updated titles, images, etc into my form fields dynamically? Do I need to utilize server technology for this or is there a simple script that when I click a button, will look at whatever excel file I have selected and say "grab this row at this column"? What is the best way to do this? Help! I'm relatively a noob when it comes to this stuff but I do know javavscript and SQL pretty well. I just can't figure out how to access my excel file to pull in the updated information. The excel file's row and column structure never changes, just the content on each row and column. Let me know if you can help. Thanks!!!! Hello, I hope this is in the right section. I am relatively new to coding and was hoping someone could point me in the right direction because at the time, I don't even know what to start researching in order to figure out how to do this. If you go to www.livingelectro.com, you will see they use the longtail media player(http://www.longtailvideo.com/players/jw-flv-player/) and pull the song to preview from a Zippyshare page. This is the code they use... (notice they do not pull a .mp3 file like I was doing from this code) Quote: <embed height="20" border="0" width="207" style="margin-bottom: 6px;" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" name="mp3player" quality="high" menu="false" src="http://www.livingelectro.com/mediaplayer.swf?backcolor=0x000000&frontcolor=0xFFFFFF&lightcolor=0xFFFFFF&file=http://www19.zippyshare.com/downloadMusic%3Fkey%3D815431413%26time%3D1249478236&type=flv" allowscriptaccess="never"/> If you look at MY website, (http://www.edmaddicts.net/index.php?...ews&Itemid=107) you will be able to scroll down and see the song preview bars. Originally, I was inserting the Zippyshare file ending in .mp3 and pulling the song up with either of these codes... Quote: <script src="swfobject.js"></script> <div id="player">This text will be replaced</div> <script type="text/javascript"> var so = new SWFObject('player-licensed.swf','mpl','470','20','9'); so.addParam('allowscriptaccess','always'); so.addParam('allowfullscreen','true'); so.addParam('flashvars','&file=(Zippysharefile.mp3)&backcolor=FFFFFF&lightcolor=660066&screencolor=6 60066&dock=false'); so.write('player'); </script> and also a flash embed code like... Quote: <embed src="player-licensed.swf"width="470"height="20"bgcolor="undefined"allowscriptaccess="always"allowfullscreen="tru e"flashvars="file=(zippysharefile.mp3)&backcolor=FFFFFF&frontcolor=000000&lightcolor=660066&screenco lor=660066&dock=false"/> The Zippyshare file .mp3 is a link stored and pulled up with {FIELDVALUE} in the database. How are they pulling the .mp3 file from Zippyshare so it works everytime? When I insert the .mp3 extension, it only works on my computer and until I reset my cookies. I can NOT host the files on my own website. I am looking forward to learning something. Will Hi.. I should warn, i know almost nothing about javascript. . i've been trying read sample scripts and examples on how to modify this script; but I just don't know enough. I have a script that pulls data from an array, and copies it directly to the clipboard when a user clicks on it. The problem is this only works in IE, because Firefox doesn't by default allow that to happen. I'm trying to change it so that when it is clicked, instead, it takes what was going to be copied to the clipboard, and puts it in a Prompt box for the user to copy and paste. I had other scripts that do that, but I can't for the life of me figure out how to learn from it! This is the function in the current script Code: <script language="javascript" type="text/javascript"> <!-- function selectThis(src) { document.selection.clear; txt = eval(src +".innerText"); theObj = document.all(txt); txtRange = document.body.createTextRange(); txtRange.moveToElementText(eval(src)); txtRange.select(); txtRange.execCommand("RemoveFormat"); txtRange.execCommand("Copy"); alert(txt + " '.$caption[ 'paste' ].'"); } --> </script> '; } and this is the onclick code Code: '; foreach ( $ausgabe as $key => $data) { if ( $key == '' ) continue; if ( ( $_GET[ 'group' ] != '*' ) && ( $this->info[ $key ][ 'xx_data' ] != $_GET[ 'group' ] ) ) continue; $tpack = $this->info[ $key ][ 'pack' ]; $tname = $this->info[ $key ][ 'xx_desc' ]; $jsid= $nick2.'_'.$tpack; if ( isset( $this->info[ $key ][ 'xx_lock' ] ) ) { if ( $this->hide_locked > 0 ) continue; $tname .= ' (gesperrt)'; } $tname = htmlspecialchars( $tname); if ( $javascript > 0 ) { $tname = '<span class="selectable" onclick="javascript:selectThis(\''. $jsid.'\');">'. $tname."</span>\n". '<span id="'.$jsid.'" class="hidden">'. '/msg '.$this->nick.' xdcc send '.$tpack."</span>\n"; } if ( isset( $this->info[ $key ][ 'xx_note' ] ) ) $tname .= '<br>'.$this->info[ $key ][ 'xx_note' ]; $label = "Download mit:\n/msg ".$this->nick.' xdcc send '.$tpack."\n"; if ( isset( $this->info[ $key ][ 'xx_md5' ] ) ) $label .= " \nmd5: ".$this->info[ $key ][ 'xx_md5' ]; if ( isset( $this->info[ $key ][ 'xx_crc' ] ) ) $label .= " \ncrc32: ".$this->info[ $key ][ 'xx_crc' ]; echo ' <tr> <td class="right">#'.$tpack.'</td> <td class="right">'.$this->info[ $key ][ 'xx_gets' ].'</td> <td class="right">'.makesize($this->info[ $key ][ 'size' ]).'</td> <td class="content" title="'.$label.'">'.$tname.'</td> </tr> '; I've spent days at trying to customize it.. but.. i'm not a programmer I was able to get it to open a prompt box, and had it populate with ("copy this code", $variable), but cannot figure out how to have it display the proper values that was clicked on. I have no idea though what is considered efficient either in the code. I hope this isn't considered asking for TOO much help.... Anyone know if there is a way to get the title string from an iframe src coming from another domain?
|