Search Results

Search found 6478 results on 260 pages for 'hippy head'.

Page 107/260 | < Previous Page | 103 104 105 106 107 108 109 110 111 112 113 114  | Next Page >

  • JavaScript regular expression literal persists between function calls

    - by Charles Anderson
    I have this piece of code: function func1(text) { var pattern = /([\s\S]*?)(\<\?(?:attrib |if |else-if |else|end-if|search |for |end-for)[\s\S]*?\?\>)/g; var result; while (result = pattern.exec(text)) { if (some condition) { throw new Error('failed'); } ... } } This works, unless the throw statement is executed. In that case, the next time I call the function, the exec() call starts where it left off, even though I am supplying it with a new value of 'text'. I can fix it by writing var pattern = new RegExp('.....'); instead, but I don't understand why the first version is failing. How is the regular expression persisting between function calls? (This is happening in the latest versions of Firefox and Chrome.) Edit Complete test case: <!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-type" content="text/html;charset=UTF-8"> <title>Test Page</title> <style type='text/css'> body { font-family: sans-serif; } #log p { margin: 0; padding: 0; } </style> <script type='text/javascript'> function func1(text, count) { var pattern = /(one|two|three|four|five|six|seven|eight)/g; log("func1"); var result; while (result = pattern.exec(text)) { log("result[0] = " + result[0] + ", pattern.index = " + pattern.index); if (--count <= 0) { throw "Error"; } } } function go() { try { func1("one two three four five six seven eight", 3); } catch (e) { } try { func1("one two three four five six seven eight", 2); } catch (e) { } try { func1("one two three four five six seven eight", 99); } catch (e) { } try { func1("one two three four five six seven eight", 2); } catch (e) { } } function log(msg) { var log = document.getElementById('log'); var p = document.createElement('p'); p.innerHTML = msg; log.appendChild(p); } </script> </head> <body><div> <input type='button' id='btnGo' value='Go' onclick='go();'> <hr> <div id='log'></div> </div></body> </html> The regular expression continues with 'four' as of the second call on FF and Chrome, not on IE7 or Opera.

    Read the article

  • Swapping two jQuery draggable list items not working properly (with jsFiddle example)

    - by Tony_Henrich
    The minimalist working example below swaps the two boxes when box 'one' is dragged and dropped on box 'two'. The problem is that when box 'one' is dropped, its style has 'top' & 'left' values causing it to be placed away from where it should drop. Its class includes 'ui-draggable-dragging'. It seems the top & left values are related to the amount the elements were dragged before the drop. And the dragging was 'interrupted' hence the residual 'ui-draggable-dragging' class? What am I missing to make the swap work seamlessly? full jsfiddle example here <html> <head> <script type="text/javascript" src="includes/jquery-1.4.2.min.js"></script> <script type="text/javascript" src="includes/jquery-ui-1.8.2.custom.min.js"></script> <script type="text/javascript"> jQuery.fn.swapWith = function(to) { return this.each(function() { var copy_to = $(to).clone(true); var copy_from = $(this).clone(true); $(to).replaceWith(copy_from); $(this).replaceWith(copy_to); }); }; $(document).ready(function() { options = {revert: true}; $("li").draggable(options) $('#wrapper').droppable({ drop: function(event, ui) { $(ui.draggable).swapWith($('#two')); } }); }); </script> </head> <body> <form> <ul id="wrapper"> <li id='one'> <div style="width: 100px; height: 100px; border: 1px solid green"> one<br /></div> </li> <li id='two'> <div style="width: 110px; height: 110px; border: 1px solid red"> two<br /></div> </li> </ul> <br /> </form> </body> </html>

    Read the article

  • Flexslider position of previous and next slides

    - by TJ15
    I am using the basic flexslider, I wantto display some of the previous and next , so if slide 2 is showing you will see part of slide 1 to the left and part of slide 3 to the right. <!DOCTYPE html> <head> <link rel="stylesheet" href="flexslider.css" type="text/css"> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> <style> .container {overflow: hidden; width: 100%} .flexslider {max-width: 500px; width: 500px; margin: 0 auto} .content {background: #f2f2f2; max-width: 500px; display: block; margin: 0 auto} .flex-viewport {overflow: visible !important} </style> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <div class="container"> <div class="flexslider"> <ul class="slides"> <li><img src="785.jpg" /></li> <li><img src="785.jpg" /></li> <li><img src="785.jpg" /></li> <li><img src="785.jpg" /></li> </ul> </div> </div> <script src="jquery.flexslider.js"></script> <script> jQuery(document).ready(function($) { // You can use the locally-scoped $ in here as an alias to jQuery. $(window).load(function() { $('.flexslider').flexslider(); }); }); </script> </body> </html> I have reduced the image to 70% and positioned it in the middle of the page. I want to have the next and previous slides visible on either side of the main pic but no idea where to make the appropriate changes (I assume in the js file). I thought this was a margin issue but setting this to 0 in styles makes no difference. Has anyone done this and can provide some advice?

    Read the article

  • Chrome extension - Localstorage not working

    - by Bjarki Jonasson
    I'm writing a Chrome extension that uses a content script to modify certain parts of a website. The content script worked fine until I tried to add an options page to my extension. Right now I'm using an options.html file to save user preferences to localstorage, as you can see here: <html> <head><title>Options</title></head> <script type="text/javascript"> function save_options() { var select = document.getElementById("width"); var width = select.children[select.selectedIndex].value; localStorage["site_width"] = width; } function restore_options() { var fwidth = localStorage["site_width"]; if (!fwidth) { return; } var select = document.getElementById("width"); for (var i = 0; i < select.children.length; i++) { var child = select.children[i]; if (child.value == fwidth) { child.selected = "true"; break; } } } </script> <body onload="restore_options()"> Width: <select id="width"> <option value="100%">100%</option> <option value="90%">90%</option> <option value="80%">80%</option> <option value="70%">70%</option> </select> <br> <button onclick="save_options()">Save</button> </body> </html> I also have a background.html file to handle the communication between the content script and the localstorage: <html> <script type="text/javascript"> chrome.extension.onRequest.addListener(function(request, sender, sendResponse) { if (request.method == "siteWidth") sendResponse({status: localStorage["site_width"]}); else sendResponse({}); }); </script> </html> Then there's the actual content script that looks like this: var Width; chrome.extension.sendRequest({method: "siteWidth"}, function(response) { width = response.status; }); None of that code actually works. It looks solid enough to me but I'm not a very experienced programmer so I might be wrong. Could someone explain localstorage to me in layman's terms?

    Read the article

  • Jquery: how to trigger td a when tr is clicked

    - by Poku
    Hey, I have a table where the first td in the trs contains a link. I want this anchor to be triggered (clicked) no matter where i click in the containing tr. I have read and tried alot of recents post and suggentions on this topic but i can't get this to work. I tried the trigger() and triggerHandle() functions, but it does not trigger the anchor click that i want. There must be others who have had the need to trigger a anchor click when a tr is clicked, so that the user doesn't have to click the tds anchor link. It sure is a nice UI feature if its possible? Here is the code i have tried: <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <script type="text/javascript" src="javascripts/jquery-1.4.2.js"></script> <script type="text/javascript" charset="utf-8"> /* Initialise the table with the required column sorting data types */ jQuery(document).ready(function () { jQuery("#rowClick tr").click(function (e) { jQuery("#clickevent", this).trigger("click"); }); }); </script> </head> <body id="dt_example"> <table id="rowClick"> <thead> <tr> <th style="width: 30px">id</th> <th style="width: 200px">navn</th> </tr> </thead> <tbody> <tr> <td><a href="datatabletext.asp?test=1" id="clickevent">1</a></td> <td>Jesper</td> </tr> <tr> <td><a href="datatabletext.asp?test=2" id="clickevent">2</a></td> <td>Bjarne</td> </tr> <tr> <td><a href="datatabletext.asp?test=3" id="clickevent">3</a></td> <td>Søren</td> </tr> </tbody> </table> </body>

    Read the article

  • Accessing Amazon E-Commerce Services through Cocoa Touch

    - by Gregory Hill
    Has anyone successfully accessed AWS (Amazon E-Commerce Services) through Cocoa Touch? I've been digging around, and haven't seen the issue addressed directly. I've created an AWS account, and have seen some sample code for accessing web services through Cocoa, but I'm not quite sure how to tie it all together. If anyone has any sample code, I'd love to see it. I'm just trying to get my head around the concepts.

    Read the article

  • TDD a controller with ASP.NET MVC 2, NUnit and Rhine Mocks

    - by Nissan Fan
    What would a simple unit test look like to confirm that a certain controller exists if I am using Rhino Mocks, NUnit and ASP.NET MVC 2? I'm trying to wrap my head around the concept of TDD, but I can't see to figure out how a simple test like "Controller XYZ Exists" would look. In addition, what would the unit test look like to test an Action Result off a view?

    Read the article

  • jQuery UI dialog + WebKit + HTML response with script

    - by Anthony Koval'
    Once again I am faced with a great problem! :) So, here is the stuff: on the client side, I have a link. By clicking on it, jQuery makes a request to the server, gets response as HTML content, then popups UI dialog with that content. Here is the code of the request-function: function preview(){ $.ajax({ url: "/api/builder/", type: "post", //dataType: "html", data: {"script_tpl": $("#widget_code").text(), "widgets": $.toJSON(mwidgets), "widx": "0"}, success: function(data){ //console.log(data) $("#previewArea").dialog({ bgiframe: true, autoOpen: false, height: 600, width: 600, modal: true, buttons: { "Cancel": function() { $(this).dialog('destroy'); } } }); //console.log(data.toString()); $('#previewArea').attr("innerHTML", data.toString()); $("#previewArea").dialog("open"); }, error: function(){ console.log("shit happens"); } }) } The response (data) is: <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <script type="text/javascript">var smakly_widget_sid = 0 ,widgets = [{"cols": "2","rows": "2","div_id": "smakly_widget","wid": "0","smakly_style": "small_image",}, ] </script> <script type="text/javascript" src="/media/js/smak/smakme.js"></script> </head> <body> preview <div id="smakly_widget" style="width:560px;height:550px"> </div> </body> </html> As you see, there is a script to load: smakme.js, somehow it doesn't execute in WebKit-based browsers (I tried in Safari and Chrome), but in Firefox, Internet Explorer and Opera it works as expected! Here is that script: String.prototype.format = function(){ var pattern = /\{\d+\}/g; var args = arguments; return this.replace(pattern, function(capture){ return args[capture.match(/\d+/)]; }); } var turl = "/widget" var widgetCtrl = new(function(){ this.render_widget = function (w, content){ $("#" + w.div_id).append(content); } this.build_widgets = function(){ for (var widx in widgets){ var w = widgets[widx], iurl = '{0}?sid={1}&wid={2}&w={3}&h={4}&referer=http://ya.ru&thrash={5}'.format( turl, smakly_widget_sid, w.wid, w.cols, w.rows, Math.floor(Math.random()*1000).toString()), content = $('<iframe src="{0}" width="100%" height="100%"></iframe>'.format(iurl)); this.render_widget(w, content); } } }) $(document).ready(function(){ widgetCtrl.build_widgets(); }) Is that some security issue, or anything else?

    Read the article

  • How does one smooth an image used as a control skin?

    - by kevmoo
    I'm embedding an image like this: [Embed(source="/tool_deleteUp.png")] private static const c_deleteButton_styleUp:Class; I'm using it like this: _removeButton = new Button(); _removeButton.setStyle('upSkin', c_deleteButton_styleUp); When I rotate the button, the image doesn't scale smoothly. I know the tricks one uses to scale an image loaded in an Image control, but I'm banging my head against a wall trying to figure out how to do it here. Help!

    Read the article

  • Where can I find sample XHTML5 source codes?

    - by Bytecode Ninja
    Where can I find sample *X*HTML 5 pages? I mainly want to know if it is possible to mix and match XHTML 5 with other XML languages just like XHTML 1 or not. For example is something like this valid in XHTML 5? <!DOCTYPE html PUBLIC "WHAT SHOULD BE HERE?" "WHAT SHOULD BE HERE?"> <html xmlns="WHAT SHOULD BE HERE?" xmlns:ui="http://java.sun.com/jsf/facelets"> <head> <title><ui:insert name="title">Default title</ui:insert></title> <link rel="stylesheet" type="text/css" href="./css/main.css"/> </head> <body> <div id="header"> <ui:insert name="header"> <ui:include src="header.xhtml"/> </ui:insert> </div> <div id="left"> <ui:insert name="navigation" > <ui:include src="navigation.xhtml"/> </ui:insert> </div> <div id="center"> <br /> <span class="titleText"> <ui:insert name="title" /> </span> <hr /> <ui:insert name="content"> <div> <ui:include src="content.xhtml"/> </div> </ui:insert> </div> <div id="right"> <ui:insert name="news"> <ui:include src="news.xhtml"/> </ui:insert> </div> <div id="footer"> <ui:insert name="footer"> <ui:include src="footer.xhtml"/> </ui:insert> </div> </body> </html> Thanks in advance.

    Read the article

  • How do I push `sed` matches to the shell call in the replacement pattern?

    - by rassie
    I need to replace several URLs in a text file with some content dependent on the URL itself. Let's say for simplicity it's the first line of the document at the URL. What I'm trying is this: sed "s/^URL=\(.*\)/TITLE=$(curl -s \1 | head -n 1)/" file.txt This doesn't work, since \1 is not set. However, the shell is getting called. Can I somehow push the sed match variables to that subprocess?

    Read the article

  • ajaxSubmit and Other Code. Can someone help me determine what this code is doing?

    - by Matt Dawdy
    I've inherited some code that I need to debug. It isn't working at present. My task is to get it to work. No other requirements have been given to me. No, this isn't homework, this is a maintenance nightmare job. ASP.Net (framework 3.5), C#, jQury 1.4.2. This project makes heavy use of jQuery and AJAX. There is a drop down on a page that, when an item is chosen, is supposed to add that item (it's a user) to an object in the database. To accomplish this, the previous programmer first, on page load, dynamically loads the entire page through AJAX. To do this, he's got 5 div's, and each one is loaded from a jquery call to a different full page in the website. Somehow, the HTML and BODY and all the other stuff is stripped out and the contents of the div are loaded with the content of the aspx page. Which seems incredibly wrong to me since it relies on the browser to magically strip out html, head, body, form tags and merge with the existing html head body form tags. Also, as the "content" page is returned as a string, the previous programmer has this code running on it before it is appended to the div: function CleanupResponseText(responseText, uniqueName) { responseText = responseText.replace("theForm.submit();", "SubmitSubForm(theForm, $(theForm).parent());"); responseText = responseText.replace(new RegExp("theForm", "g"), uniqueName); responseText = responseText.replace(new RegExp("doPostBack", "g"), "doPostBack" + uniqueName); return responseText; } When the dropdown itself fires it's onchange event, here is the code that gets fired: function SubmitSubForm(form, container) { //ShowLoading(container); $(form).ajaxSubmit( { url: $(form).attr("action"), success: function(responseText) { $(container).html(CleanupResponseText(responseText, form.id)); $("form", container).css("margin-top", "0").css("padding-top", "0"); //HideLoading(container); } } ); } This blows up in IE, with the message that "Microsoft JScript runtime error: Object doesn't support this property or method" -- which, I think, has to be that $(form).ajaxSubmit method doesn't exist. What is this code really trying to do? I am so turned around right now that I think my only option is to scrap everything and start over. But I'd rather not do that unless necessary. Is this code good? Is it working against .Net, and is that why we are having issues?

    Read the article

  • how to set a polyline on google maps every time when i click twice(make two markers) on maps,

    - by zjm1126
    this is my code : thanks <!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=5.0,user-scalable=yes"> </head> <body onload="initialize()" onunload="GUnload()"> <style type="text/css"> </style> <div id="map_canvas" style="width: 500px; height: 300px;float:left;"></div> <script src="jquery-1.4.2.js" type="text/javascript"></script> <script src="jquery-ui-1.8rc3.custom.min.js" type="text/javascript"></script> <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAA-7cuV3vqp7w6zUNiN_F4uBRi_j0U6kJrkFvY4-OX2XYmEAa76BSNz0ifabgugotzJgrxyodPDmheRA&sensor=false"type="text/javascript"></script> <script type="text/javascript"> //********** function initialize() { if (GBrowserIsCompatible()){ //var map = new GMap2(document.getElementById("map_canvas")); //map.setCenter(new GLatLng(39.9493, 116.3975), 13); var map = new GMap2(document.getElementById("map_canvas")); var center=new GLatLng(39.917,116.397); map.setCenter(center, 13); map.addOverlay(new GMarker(new GLatLng(39.917,116.397))); map.enableDrawing() //GEvent.addListener(map, "mouseover", function() { //alert("???????"); //}); var one; aFn=function(y_scale,x_scale){ //************ //function p(){ var bounds = map.getBounds(); var southWest = bounds.getSouthWest(); var northEast = bounds.getNorthEast(); var lngSpan = northEast.lng() - southWest.lng(); var latSpan = northEast.lat() - southWest.lat(); var point = new GLatLng(southWest.lat() + latSpan * (1-y_scale), southWest.lng() + lngSpan * x_scale); if(!one){ map.addOverlay(new GMarker(point)); one=point; }else{ var polyline = new GPolyline([one,point], "#ff0000", 5); map.addOverlay(polyline); one=0; } } //********** //************* } } </script> </body> </html>

    Read the article

  • How to get a long url from a short url

    - by JK
    I would like to determine what the long url of a short url is. I have tried using http HEAD requests, but very few of the returned header fields actually contain any data pertaining to the destination/long url. Is there: 1. Any way to determine the long url? 2. If so, can it be done without downloading the body of the destination? Thank you

    Read the article

  • what will be the code to move to previous textfield ?

    - by rajesh
    i have the code if i press down button it goes to next textfield but to go to previous textfield what should be the code ... <html> <head> <script language="JavaScript"> function handleKeyDownEvent(elementRef,eventRef) { var charCode = (window.event) ? eventRef.keyCode : eventRef.which; //alert(charCode); // Arrow keys (37:left, 38:up, 39:right, 40:down)... if (charCode == 40) { if (window.event) window.event.keyCode = 9; else event.which = 9; return true; } return true; } </script> </head> <body> <table width="433" border="1" cellspacing="0" cellpadding="0"> <tr> <td width="235" align="center"><input type="text" onKeyDown="handleKeyDownEvent(this,event);" onKeyUp="handleKeyUpEvent(this,event);"></td> <td width="235" align="center"><input type="text" onKeyDown="handleKeyDownEvent(this,event);" onKeyUp="handleKeyUpEvent(this,event);"></td> </tr> <tr> <td width="235" align="center"><input type="text" onKeyDown="handleKeyDownEvent(this,event);" onKeyUp="handleKeyUpEvent(this,event);"></td> <td width="235" align="center"><input type="text" onKeyDown="handleKeyDownEvent(this,event);" onKeyUp="handleKeyUpEvent(this,event);"></td> </tr> <tr> <td> <input type="radio" id="check" name="check" checked> </td> <td> <input type="radio" id="check" name="check" checked> </td> </tr> <tr> <td><input type="checkbox" id="check" name="check"></td> <td><input type="checkbox" id="check" name="check"></td> </tr> </table> </body> </html>

    Read the article

  • improve javascript prototypal inheritance

    - by Julio
    I'm using a classical javascript prototypal inheritance, like this: function Foo() {} Naknek.prototype = { //Do something }; var Foo = window.Foo = new Foo(); I want to know how I can improve this and why I can't use this model: var Foo = window.Foo = new function() { }; Foo.prototype = { //Do something }; Why this code doesn't work? In my head this is more logical than the classical prototypal inheritance.

    Read the article

  • Assigning values to chars in structs - c

    - by mrblippy
    Hi, i have been having trouble getting my head around allowing a user to enter words into structs. the struct i am using is below struct class { char class_num[4]; char *class_name } if anyone could point me how to do this or at least point me in the right direction that wuld be great. thanks

    Read the article

  • Python and displaying HTML

    - by Tyler Seymour
    I've gotten pretty comfortable with Python and now I'm looking to make a rudimentary web application. I was somewhat scared of Django and the other Python frameworks so I went caveman on it and decided to generate the HTML myself using another Python script. Maybe this is how you do it anyways - but I'm just figuring this stuff out. I'm really looking for a tip-off on, well, what to do next. My Python script PRINTS the HTML (is this even correct? I need it to be on a webpage!), but now what? Thanks for your continued support during my learning process. One day I will post answers! -Tyler Here's my code: from SearchPhone import SearchPhone phones = ["Iphone 3", "Iphone 4", "Iphone 5","Galaxy s3", "Galaxy s2", "LG Lucid", "LG Esteem", "HTC One S", "Droid 4", "Droid RAZR MAXX", "HTC EVO", "Galaxy Nexus", "LG Optimus 2", "LG Ignite", "Galaxy Note", "HTC Amaze", "HTC Rezound", "HTC Vivid", "HTC Rhyme", "Motorola Photon", "Motorola Milestone", "myTouch slide", "HTC Status", "Droid 3", "HTC Evo 3d", "HTC Wildfire", "LG Optimus 3d", "HTC ThunderBolt", "Incredible 2", "Kyocera Echo", "Galaxy S 4g", "HTC Inspire", "LG Optimus 2x", "Samsung Gem", "HTC Evo Shift", "Nexus S", "LG Axis", "Droid 2", "G2", "Droid x", "Droid Incredible" ] print """<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>table of phones</title> </head> <body> </body> </html> """ #table print '<table width="100%" border="1">' for x in phones: y = SearchPhone(x) print "\t<tr>" print "\t\t<td>" + str(y[0]) + "</td>" print "\t\t<td>" + str(y[1]) + "</td>" print "\t\t<td>" + str(y[2]) + "</td>" print "\t\t<td>" + str(y[3]) + "</td>" print "\t\t<td>" + str(y[4]) + "</td>" print "\t</tr>" print "</table>

    Read the article

  • SVN branch question

    - by aspdotnetuser
    Hi, When creating a branch, what are the implications of selecting the following? Create copy in the repository from: HEAD revision in the repository Specific revision the repository Working copy

    Read the article

  • How to put Google adsense in iPhone application?

    - by oksk
    Hi all. I have a question about adsense. I want to put Google adsense in my application to be developed. But after testing my code, It wasn't shown. this is my code self.webView.userInteractionEnabled = NO; NSMutableString *manageableHTML = [[[NSMutableString alloc] init] autorelease]; [manageableHTML appendFormat:@"<html><head></head>"]; [manageableHTML appendFormat:@"<body>"]; [manageableHTML appendFormat:@"<script type=\"text/javascript\"><!--"]; [manageableHTML appendFormat:@"window.googleAfmcRequest = {"]; [manageableHTML appendFormat:@"client: 'ca-mb-pub-7564235160823935',"]; [manageableHTML appendFormat:@"ad_type: 'text_image',"]; [manageableHTML appendFormat:@"output: 'html',"]; [manageableHTML appendFormat:@"channel: '2052458338',"]; [manageableHTML appendFormat:@"format: '320x50_mb',"]; [manageableHTML appendFormat:@"oe: 'utf8',"]; [manageableHTML appendFormat:@"color_border: '336699',"]; [manageableHTML appendFormat:@"color_bg: 'FFFFFF',"]; [manageableHTML appendFormat:@"color_link: '0000FF',"]; [manageableHTML appendFormat:@"color_text: '000000',"]; [manageableHTML appendFormat:@"color_url: '008000',"]; [manageableHTML appendFormat:@"};"]; [manageableHTML appendFormat:@"//--></script>"]; [manageableHTML appendFormat:@"<script type=\"text/javascript\" "]; [manageableHTML appendFormat:@"src=\"http://pagead2.googlesyndication.com/pagead/show_afmc_ads.js\"></script>"]; [manageableHTML appendFormat:@"</body></html>"]; [self.webView loadHTMLString:manageableHTML baseURL:nil]; [self.view addSubview:self.webView]; Bofore testing, this javascript code are well operated in my google blog. I found that this code work at only mobile device. and I checked it through safari of my ipod touch. (It works well.) But Checking in the application, I don't see adsense. what is something wrong?

    Read the article

  • unable to trigger event in IE during clonning

    - by Abhimanyu
    Following is the code which will clone a set of div with their events(onclick) which is working fine for FF but in case of IE it is not firing events associated with each div. <html> <head> <style type='text/css'> .firstdiv{ border:1px solid red; } </style> <script language="JavaScript"> function show_tooltip(idx,condition,ev) { alert(idx +"=="+condition+"=="+ev); } function createCloneNode () { var cloneObj = document.getElementById("firstdiv").cloneNode(true); document.getElementById("maindiv").appendChild(cloneObj); } function init(){ var mainDiv = document.createElement("div"); mainDiv.id = 'maindiv'; var firstDiv = document.createElement("div"); firstDiv.id ='firstdiv'; firstDiv.className ='firstdiv'; for(var j=0;j<4;j++) { var summaryDiv = document.createElement("div"); summaryDiv.id = "sDiv"+j summaryDiv.className ='summaryDiv'; summaryDiv.onmouseover = function() {this.setAttribute("style","text-decoration:underline;cursor:pointer;");} summaryDiv.onmouseout = function() {this.setAttribute("style","text-decoration:none;");} summaryDiv.setAttribute("onclick", "show_tooltip("+j+",'view_month',event)"); summaryDiv.innerHTML = 'Div'+j; firstDiv.appendChild(summaryDiv); } mainDiv.appendChild(firstDiv); var secondDiv = document.createElement("div"); var linkDiv = document.createElement("div"); linkDiv.innerHTML ='create clone of above element'; linkDiv.onclick = function() { createCloneNode(); } secondDiv.appendChild(linkDiv); mainDiv.appendChild(secondDiv); document.body.appendChild(mainDiv); } </script> </head> <body> <script language="JavaScript"> init() </script> </body> </html> can anybody tell me whats the problem in above code please correct me..

    Read the article

  • jQuery Validator's "required" not working when value is set at statup

    - by nandrew
    Hello, I have a problem with jQuery Validator. I want to use "required" property on a text input. It doesn't work when input has set value attribute by HTML code (tested on Firefox (3.5), and on IE 8 - on IE it works a bit better). Story: 1. Page loads; 2. value is cleared; 3. focus is changed. 4. Nothing happens but the error message should be displayed; 5. getting back to the field and typing some characters. 6. changing focus; 7. getting back to the field; 8. clearing the field. 9. Error is displayed even before leaving the field. The HTML code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head> <script src="Web/Scripts/jquery-1.3.2.min.js" type="text/javascript"></script> <script src="Web/Scripts/jquery.validate.js" type="text/javascript"></script> </head> <body> <form id="form1"> <input type="text" id="name1" name="name1" value="test" /><br /> <input type="text" /> </form> <script type="text/javascript"> $(document).ready(function() { var validator = $("form").validate({ rules: { name1: { required: true, minlength: 2 } }, messages: { name1: "bad name" }, }); }); </script> </body> </html>

    Read the article

  • why this sql code dont work

    - by magy
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1256"> <title>??? ?????? ???? ????</title> </head> <body> <table width="100%" border="1"> <tr> <td>name</td> <td>number</td> <td>math</td> <td>arab</td> <td>history</td> <td>geo</td> </tr> <?php require_once "conf.php"; $sql2=("SELECT * FROM student WHERE snum = $ss"); $rs2 = mysql_query($sql2) or die(mysql_error()); $num = mysql_num_rows($rs2); $ss= $_POST["ss"]; if (empty($ss)) { echo "please write your search words";} else if ($num < 1 ) { echo "not found any like "; }else { $sql=("SELECT * FROM student WHERE snum = $ss "); $rs = mysql_query($sql) or die(mysql_error()); while($data=mysql_fetch_array($rs)){ $name=$data["sname"]; $number=$data["snum"]; $math=$data["math"]; $arab=$data["arab"]; $history=$data["history"]; $geo=$data["geo"]; echo" <tr> <td>$name</td> <td>$number</td> <td>$math</td> <td>$arab</td> <td>$history</td> <td>$geo</td> </tr> "; } }; ?> </table> </body> </html>

    Read the article

< Previous Page | 103 104 105 106 107 108 109 110 111 112 113 114  | Next Page >