Jump to content

Search the Community

Showing results for tags 'javascript error'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 2 results

  1. Hey All Firstly, i'm new to Javascript and I am basically copying and pasting code I was given but have run into a few issues. The code below allows a user to share a web page to Yammer (enterprise social networking site). What is suppost to happen is the link opens a pop up window where additional comments can be added before sharing (this part all works fine). However, the issue I have is that as well as a pop up window appearing the "parent" window also follows the link when I do not want this window navigating away from the page the user was on. I am only experiencing this problem in internet explorer 8, it works fine in Google Chrome. Is there anything I can change in the code to prevent this from happening? Any help would be appreciated!! <h2>Share this page . . . </h2> <div align="center"> <a href="javascript:var d=document,w=window,e=w.getSelection,k=d.getSelection,x=d.selection,s=(e?e():(k)?k():(x?x.createRange().text:0)),f= 'https://www.yammer.com/home/bookmarklet',l=d.location,e=encodeURIComponent,p='?bookmarklet_pop=1&v=1&u='+e(l.href)%20+'&t='+e(d.title.replace(/^ *| *$/g,''))%20+'&s='+e(s),u=f+p;a=function()%20{if%20(!window.open(u,'sharer','toolbar=0,status=0,resizeable=1,width=650,height=550'))l.href=f+p};if%20(/Firefox/.test(navigator.userAgent))setTimeout(a,0);else{a()}void(0);"> <img src="https://c64.assets-yammer.com/images/clients/bookmarklet_icon.png" border=0 /> </a> </div>
  2. Html is <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>Reporting Events</title> <!--[if lt IE 9]> <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <link rel="stylesheet" href="css/form.css"> </head> <body> <!-- Script 8.7 - events.html --> <form action="#" method="post" id=U.$('theForm')> <fieldset><legend>Reporting Events</legend> <p>Select the events you want to listen for:</p> <div><label for="mouseover">mouseover</label><input type="checkbox" name="mouseover" id="mouseover" value="mouseover"></div> <div><label for="mouseout">mouseout</label><input type="checkbox" name="mouseout" id="mouseout" value="mouseout"></div> <div><label for="click">click</label><input type="checkbox" name="click" id="click" value="click"></div> <div><label for="keypress">keypress</label><input type="checkbox" name="keypress" id="keypress" value="keypress"></div> <div><label for="blur">blur</label><input type="checkbox" name="blur" id="blur" value="blur"></div> <div><input type="submit" value="Submit" id="submit"></div> <div><label for="output">Output</label><textarea name="output" id="output" disabled></textarea></div> </fieldset> </form> <script src="js/utilities.js"></script> <script src="js/events.js"></script> </body> </html> utilities.js is var U = { $: function(id) { 'use strict'; if (typeof id == 'string') { return document.getElementById(id); } }, // End of $() function. setText: function(id, message) { 'use strict'; if ( (typeof id == 'string') && (typeof message == 'string') ) { var output = this.$(id); if (!output) return false; if (output.textContent !== undefined) { output.textContent = message; } else { output.innerText = message; } return true; } // End of main IF. }, // End of setText() function. addEvent: function(obj, type, fn) { 'use strict'; if (obj && obj.addEventListener) { obj.addEventListener(type, fn, false); } else if (obj && obj.attachEvent) { obj.attachEvent('on' + type, fn); } }, // End of addEvent() funtion. removeEvent: function(obj, type, fn) { 'use strict'; if (obj && obj.removeEventListener) { obj.removeEventListener(type, fn, false); } else if (obj && obj.detachEvent) { obj.detachEvent('on' + type, fn); } } // End of removeEvent() function. }; // End of U declaration. The events.js is function reportEvent(e) { 'use strict'; if (typeof e == 'undefined') e = window.event; var target = e.target || e.srcElement; var msg = target.nodeName + ': ' + e.type + '\n'; U.$('output').value += msg; } // End of reportEvent() function. function setHandlers(e) { 'use strict'; var event = ['mouseover', 'mouseout', 'click', 'keypress', 'blur']; for (var i = 0, count = events.length; i < count; i++) { var checkbox = U.$(events); if (checkbox.checked) { U.addEvent(document, events, reportEvent); } else { U.removeEvent(document, evets, reportEvent); } } // End of FOR loop. U.$('output').value = ''; return false; } //End of setHandlers9 function. window.onload = function() { 'use strict'; U.$('theForm').onsubmit = setHandlers; }; Any help would be awesome!
×
×
  • 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.