Search Results

Search found 27 results on 2 pages for 'powerboy'.

Page 1/2 | 1 2  | Next Page >

  • How to destroy tinymce completely?

    - by powerboy
    I am working on something like this: On a webpage, there is an article wrapped in a DIV, an Edit button. When a user click on the Edit button, insert an textarea via javascript, load the html of the DIV into the textarea, load and initial tinymce. When the user click on the Save button, save and update the article via ajax, and destroy tinymce completely. The problem is that, I failed to destroy tinymce completely. When the user click on the Edit button again, a new tinymce instance will load while the old instance is just hidden. BTW, I am using the jQuery version of tinymce

    Read the article

  • $('<style></style>').text('css').appendTo('head') does not work in IE?

    - by powerboy
    It works fine in Firefox and Chrome, but does not work in IE8. Here is the html structure: <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script type="text/javascript"> $(function() { // this does not work in the stupid IE $('<style type="text/css"></style>').text('body {margin: 0;}').appendTo('head'); }); </script> </head> <body> </body> </html> And what' s the alternative to do this in IE?

    Read the article

  • extra vertical space within <li> in IE7

    - by powerboy
    The test case is in below. Or you can view it in jsbin: http://jsbin.com/uxagi. <!DOCTYPE html> <html> <head> <style type="text/css"> body {margin: 20px; } #main {border: 1px solid red;} img {float: left; height: 100px; padding: 0 10px 10px 0;} ul {margin: 0; padding: 0; list-style-type: none;} </style> </head> <body> <div id="main"> <ul> <li> <img src="http://upload.wikimedia.org/wikipedia/en/thumb/0/07/CranebyLinson1894.jpg/100px-CranebyLinson1894.jpg" /> <div class="content">"The Open Boat" is a short story by American author Stephen Crane. First published in 1897, it was based on Crane's experience of having survived a shipwreck off the coast of Florida earlier that year while traveling to Cuba to work as a newspaper correspondent. Crane was stranded at sea for thirty hours when his ship, the SS Commodore, sank after hitting a sandbar. He and three other men were forced to navigate their way to shore in a small boat; one of the men, an oiler named Billie Higgins, drowned. Crane subsequently adapted his report into narrative form, and the short story "The Open Boat" was published in Scribner's Magazine. The story is told from the point of view of an anonymous correspondent, Crane's fictional doppelgänger, and the action closely resembles the author's experiences after the shipwreck. A volume titled The Open Boat and Other Tales of Adventure was published in the United States in 1898. Praised for its innovation by contemporary critics, the story is considered an exemplary work of literary Naturalism. One of the most frequently discussed works in Crane's canon, it is notable for its use of imagery, irony, symbolism, and exploration of themes including survival, solidarity, and the conflict between man and nature. H. G. Wells considered "The Open Boat" to be "beyond all question, the crown of all [Crane's] work".</div> </li> </ul> </div> </body> </html> Note that in standards-compliant browsers and IE8, there is no vertical space between the red border and the text. But there is vertical space in IE7 (haven't tested in IE6).

    Read the article

  • firefox window.onerror event problem - alerts "Script error!" only

    - by powerboy
    I use the window.onerror to alert javascript errors for debugging. window.onerror = function(msg, url, line) { alert(msg + '\nLine: ' + line); }; When an error is fired, it can alert this actual error message in IE. But in firefox, it just alerts "Script error!", but I can still see the actual error message in firefox's error console. I remembered several months ago when I worked on another project, firefox did not work like this. But I cannot get the code of that project currently. So I wonder what are the possible problems with this?

    Read the article

  • jQuery-ui tabs: interference between tabs

    - by powerboy
    I use the jQuery-ui tabs widget as a navigation. Contents of all tabs are load via ajax. Seems that there is interference between tabs. I mean, for example, if in page1 in tab1, there is an element whose ID is foo, and in page2 in tab2, there is an element with the same ID. And in both page, there is javascript code to manipulate the element with ID foo, then weird things will happen. How to deal with this situation?

    Read the article

  • share the same cookie between two website using PHP cURL extension

    - by powerboy
    I want to get the contents of some emails in my gmail account. I would like to use the PHP cURL extension to do this. I followed these steps in my first try: In the PHP code, output the contents of https://www.google.com/accounts/ServiceLoginAuth. In the browser, the user input username and password to login. In the PHP code, save cookies in a file named cookie.txt. In the PHP code, send request to https://mail.google.com/ along with cookies retrieved from cookie.txt and output the contents. The following code does not work: $login_url = 'https://www.google.com/accounts/ServiceLoginAuth'; $gmail_url = 'https://mail.google.com/'; $cookie_file = dirname(__FILE__) . '/cookie.txt'; $ch = curl_init(); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file); curl_setopt($ch, CURLOPT_URL, $login_url); $output = curl_exec($ch); echo $output; curl_setopt($ch, CURLOPT_URL, $gmail_url); curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_file); $output = curl_exec($ch); echo $output; curl_close($ch);

    Read the article

  • JavaScript DOM dimension properties (height, width) vs. jQuery dimension methods

    - by powerboy
    Take height for example. JQ height() <=> JS height // WITHOUT padding, border and margin, including invisible areas JQ innerHeight() <==> JS ??? // WITH padding, WITHOUT border and margin, including invisible areas JQ outerHeight(false) <==> JS ??? // WITH padding and border, WITHOUT margin, including invisible areas JQ outerHeight(true) <==> JS ??? // WITH padding, border and margin, including invisible areas JQ ??? <=> JS offsetHeight // WITH padding and border, WITHOUT margin, NOT including invisible areas JQ ??? <=> JS clientHeight // WITH padding, WITHOUT border and margin, NOT including invisible areas Please help me to correct and complete the list.

    Read the article

  • How to find the closest descendants (hat matches a selector) with jQuery?

    - by powerboy
    We can use closest(selector) to find the first ancestor element that matches the selector. It travels up the DOM tree until it finds a match for the selector. But what if I want to travels down the DOM tree until it finds a match for the selector? Is there any jQuery function for doing this? Give an example. For the DOM tree below, <div id="main"> <div> <ul><!-- I want to match this ul --> <li> <ul><!-- but not this ul --> </ul> </li> </ul> <ul><!-- and match this ul --> </ul> </div> </div> how to do something like $('#main').closestDescendants('ul')?

    Read the article

  • extract variables from an expression using javascript regexp

    - by powerboy
    For example, here is a string representing an expression: var str = 'total = sum(price * qty) * 1.09875'; I want to extract variables (i.e., 'total', 'price' and 'qty' but not 'sum' since 'sum' is a function name) from this expression. What is the regexp pattern in javascript? Variable name consists of letters, digits, or the underscore, beginning with letters or the underscore.

    Read the article

  • How to find the closest descendants (that matches a selector) with jQuery?

    - by powerboy
    We can use closest(selector) to find the first ancestor element that matches the selector. It travels up the DOM tree until it finds a match for the selector. But what if I want to travels down the DOM tree until it finds a match for the selector? Is there any jQuery function for doing this? Or do I need to implement this using breadth-first search? Give an example. For the DOM tree below, <div id="main"> <div> <ul><!-- I want to match this ul --> <li> <ul><!-- but not this ul --> </ul> </li> </ul> <ul><!-- and match this ul --> </ul> </div> </div> how to do something like $('#main').closestDescendants('ul')?

    Read the article

  • C++: calling member functions within constructor?

    - by powerboy
    The following code raises a runtime error: #include <iostream> #include <iterator> #include <ext/slist> class IntList : public __gnu_cxx::slist<int> { public: typedef IntList::iterator iterator; IntList() { tail_ = begin(); } // seems that there is a problem here void append(const int node) { tail_ = insert_after(tail_, node); } private: iterator tail_; }; int main() { IntList list; list.append(1); list.append(2); list.append(3); for (IntList::iterator i = list.begin(); i != list.end(); ++i) { std::cout << *i << " "; } return 0; } Seems that the problem is in the constructor IntList(). Is it because it calls the member function begin()?

    Read the article

  • PHP: get contents of a remote webpage that require authentication?

    - by powerboy
    I receive many emails whose contents are of the same pattern, e.g. Name: XXX Phone: XXX Bio: XXX ...... I want to write a PHP script to parse these emails and save the data into a database. I tried to use file_get_contents() to get the contents of these emails. The problem is that, it requires authentication to access to my emails. Even though I have signed into my email account on the server (localhost actually), file_get_contents() still return the webpage that prompts me to sign in. So how to access the contents of my emails with a PHP script? EDIT: it is a gmail account.

    Read the article

  • several jquery ui theme switcher problems (cookie, different themes for different pages, etc.)

    - by powerboy
    I just try putting the jquery-ui theme switcher on my website. Seems that there are some problems: Cookie does not work. When I close the browser and reopen the webpage, the default theme will load instead of the one selected before. The selected theme is valid for current page only. If jumping to another page, it will load the default. I want to select once and apply to all pages. There is a flash of the default theme before the selected theme get loaded. Anyone know an easy way deal with these problems? I know I can implement my own cookie solution based on that theme switcher, but I was so surprised that the author did not provide options to do these.

    Read the article

1 2  | Next Page >