Search Results

Search found 922 results on 37 pages for 'h2'.

Page 16/37 | < Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >

  • javasript function

    - by user289346
    var curtext="View large image"; function changeSrc() { if(curtext == "View large image"){ document.getElementById("boldStuff").innerHTML ="View small image"; curtext="View small image"; } else{ document.getElementById("boldStuff").innerHTML="View large image"; curtext="View large image"; } } var curimage="cottage_small.jpg"; function changeSrc(){ if(curimage == "cottage_small.jpg"){ document.getElementById("myImage").src="cottage_large.jpg"; curimage="cottage_large.jpg"; } else{ document.getElementById("myImage").src="cottage_small.jpg"; curimage="cottage_small.jpg"; } } </script> </head> <body> <!-- Your page here --> <h1> Pink Knoll Properties</h1> <h2> Single Family Homes</h2> <p> Cottage:<strong>$149,000</strong><br/> 2 bed, 1 bath, 1,189 square feet, 1.11 acres <br/><br/> <a href="#" onclick="changeSrc()"><b id="boldStuff" />View large image</a></p> <p><img id="myImage" src="cottage_small.jpg" alt="Photo of a cottage" /></p> </body> I need help, how to put as one function with two arguments. That means when you click, the image and text both will be change. Thank you! Bianca

    Read the article

  • Container/Wrapper Div does not contain all content?

    - by Imran
    Container/Wrapper Div does not contain all content (ie all the child Div's).I've tried overflow: hidden but still doesn't work. Can someone please tell me why this is happening and what are the possible solutions. Thank you in advance ;-) for some reason the whole code does not display?? <html> <head> <style type="text/css"> #wrapper { margin:0 auto; width: 600px; background: yellow; } </style> </head> <body> <div id="wrapper"> <div="header"> <h1>my beautiful site</h1> </div> <div id="navigation"> <ul> <li><a href="#">Home </li> <li><a href="#">About</li> <li><a href="#">Services</li> <li><a href="#">Contact us </li> </ul> </div> <div id ="content"> <h2> subheading<h2> <p> long paragraph </p> </div> <div id ="footer"> copyright 123 </div> </div> </body> </html>

    Read the article

  • refering Tomcat JNDI datasource in persistence.xml

    - by binary_runner
    in server.xml I've defined global resource (I'm using Tomcat 6): <GlobalNamingResources> <Resource name="jdbc/myds" auth="Container" type="javax.sql.DataSource" maxActive="10" maxIdle="3" maxWait="10000" username="sa" password="" driverClassName="org.h2.Driver" url="jdbc:h2:~/.myds/data/db" /> </GlobalNamingResources> I see in catalina.out that this is bound, so I suppose it's OK. In my web app I have the link to the datasource, I'm not sure it's OK: <Context> <ResourceLink global='jdbc/myds' name='jdbc/myds' type="javax.sql.Datasource"/> </Context> and in application there is persistence.xml : <persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd" version="2.0"> <persistence-unit name="oam" transaction-type="RESOURCE_LOCAL"> <provider>org.hibernate.ejb.HibernatePersistence</provider> <non-jta-data-source>jdbc/myds</non-jta-data-source> <!-- class definitions here, nothing else --> <properties> <property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect"/> </properties> </persistence-unit> </persistence> It shuld be OK, but most probably this or the ResourceLink definition is wrong because I'm getting: javax.naming.NameNotFoundException: Name jdbc is not bound in this Context What's wrong and why this does not work ?

    Read the article

  • How to add an image when generating a pdf-file with javascript. When adding the imageLoadFromURL no pdf is generated

    - by Angu Handschuh
    I've got a problem with adding an image when generating a pdf-file with javascript. Here is my code: <!DOCTYPE html> <html> <head> <script type="text/javascript" src="base64.js"></script> <script type="text/javascript" src="sprintf.js"></script> <script type="text/javascript" src="jspdf.js"></script> <script> function demo1() { var name = prompt('Name: '); var nachname=prompt('Nachname: '); var doc = new jsPDF(); doc.setFontSize(22); doc.text(20, 20, 'Der eingegebene Text'); doc.setFontSize(16); doc.imageLoadFromUrl('image.jpg'); doc.imagePlace(20, 40); doc.text(20, 30, 'Name: ' + name); doc.text(20,40,'Nachname:'+nachname); // Output as Data URI doc.output('datauri'); } </script> </head> <body> <h2> Ein Document </h2> <a href="javascript:demo1()"> PDF erstellen </a> </body> </html> Before adding doc.imageLoadFromUrl('image.jpg'); doc.imagePlace(20, 40); the code runs without picture. It starts with a demand note for the name and the second name, after this it generates a pdf-file. But when adding the imageLoad-Method there is no pdf-file generated. Does anyone konws how to solve this problem?

    Read the article

  • ASP.NET and VB.NET OleDbConnection Problem

    - by Matt
    I'm working on an ASP.NET website where I am using an asp:repeater with paging done through a VB.NET code-behind file. I'm having trouble with the database connection though. As far as I can tell, the paging is working, but I can't get the data to be certain. The database is a Microsoft Access database. The function that should be accessing the database is: Dim pagedData As New PagedDataSource Sub Page_Load(ByVal obj As Object, ByVal e As EventArgs) doPaging() End Sub Function getTheData() As DataTable Dim DS As New DataSet() Dim strConnect As New OleDbConnection("Provider = Microsoft.Jet.OLEDB.4.0;Data Source=App_Data/ArtDatabase.mdb") Dim objOleDBAdapter As New OleDbDataAdapter("SELECT ArtID, FileLocation, Title, UserName, ArtDate FROM Art ORDER BY Art.ArtDate DESC", strConnect) objOleDBAdapter.Fill(DS, "Art") Return DS.Tables("Art").Copy End Function Sub doPaging() pagedData.DataSource = getTheData().DefaultView pagedData.AllowPaging = True pagedData.PageSize = 2 Try pagedData.CurrentPageIndex = Int32.Parse(Request.QueryString("Page")).ToString() Catch ex As Exception pagedData.CurrentPageIndex = 0 End Try btnPrev.Visible = (Not pagedData.IsFirstPage) btnNext.Visible = (Not pagedData.IsLastPage) pageNumber.Text = (pagedData.CurrentPageIndex + 1) & " of " & pagedData.PageCount ArtRepeater.DataSource = pagedData ArtRepeater.DataBind() End Sub The ASP.NET is: <asp:Repeater ID="ArtRepeater" runat="server"> <HeaderTemplate> <h2>Items in Selected Category:</h2> </HeaderTemplate> <ItemTemplate> <li> <asp:HyperLink runat="server" ID="HyperLink" NavigateUrl='<%# Eval("ArtID", "ArtPiece.aspx?ArtID={0}") %>'> <img src="<%# Eval("FileLocation") %>" alt="<%# DataBinder.Eval(Container.DataItem, "Title") %>t"/> <br /> <%# DataBinder.Eval(Container.DataItem, "Title") %> </asp:HyperLink> </li> </ItemTemplate> </asp:Repeater>

    Read the article

  • Set predefine form value (webbrowser control)

    - by Khou
    Hi I want to load my windows form: web browser thats using the webbrowser control, It would load a web page, and load my defination and search for elements that has been define, it will then assign the default values and these values can not be changed by the end user. Example If my application finds "FirstName" it would always assign the value "John" If my application finds "LastName" it would always assign the value "Smith" (these values should not be changed by the end user). Here's how to do it in HTML/JAVASCRIPT, but how do i do this in a windows form? HTML <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>page title</title> <script script type="text/javascript" src="demo1.js"></script> </head> <body onload="def(document.someform, 'name', 'my default name value');"> <h2 style="color: #8e9182">test form title</h2> <form name="someform" id="someform_frm" action="#"> <table cellspacing="1"> <tr><td><label for="name">NameX: </label></td><td><input type="text" size="30" maxlength="155" name="name" onchange="def(document.someform, 'name', 'my default name value');"></td></tr> <tr><td><label for="name2">NameY: </label></td><td><input type="text" size="30" maxlength="155" name="name2"></td></tr> <tr><td colspan="2"><input type="button" name="submit" value="Submit" onclick="showFormData(this.form);" ></td></table> </form> </body> </html> JAVASCRIPT function def(oForm, element_name, def_txt) { oForm.elements[element_name].value = def_txt; }

    Read the article

  • MVC View Model Intellisense / Compile error

    - by Marty Trenouth
    I have one Library with my ORM and am working with a MVC Application. I have a problem where the pages won't compile because the Views can't see the Model's properties (which are inherited from lower level base classes). They system throws a compile error saying that 'object' does not contain a definition for 'ID' and no extension method 'ID' accepting a first argument of type 'object' could be found (are you missing a using directive or an assembly reference?) implying that the View is not seeing the model. In the Controller I have full access to the Model and have check the Inherits from portion of the view to validate the correct type is being passed. Controller: return View(new TeraViral_Blog()); View: <%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<com.models.TeraViral_Blog>" %> <asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server"> Index2 </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"> <h2>Index2</h2> <fieldset> <legend>Fields</legend> <p> ID: <%= Html.Encode(Model.ID) %> </p> </fieldset> </asp:Content>

    Read the article

  • Getting problem in collision detection in Java Game

    - by chetans
    Hi I am developing Spaceship Game in which i am getting problem in collision detection of moving images Game has a spaceship and number of asteroids(obstacles) i want to detect the collision between them How can i do this?`package Game; import java.applet.Applet; import java.awt.Color; import java.awt.Dimension; import java.awt.Graphics; import java.awt.Image; import java.awt.MediaTracker; import java.awt.event.KeyEvent; import java.awt.event.KeyListener; import java.net.MalformedURLException; import java.net.URL; public class ThreadInApplet extends Applet implements KeyListener { private static final long serialVersionUID = 1L; Image[] asteroidImage; Image spaceshipImage; int[] XPosObst,YPosObst; int numberOfObstacles=0,XPosOfSpaceship,YPosOfSpaceship; int spaceButtnCntr=0,noOfObstaclesLevel=20; boolean gameStart=false,collideUp=false,collideDown=false,collideLeft=false,collideRight=false; private Image offScreenImage; private Dimension offScreenSize,d; private Graphics offScreenGraphics; int speedObstacles=1; String spaceshipImagePath="images/spaceship.png",obstacleImagepath="images/asteroid.png"; String buttonToStart="Press Space to start"; public void init() { try { asteroidImage=new Image[noOfObstaclesLevel]; XPosObst=new int[noOfObstaclesLevel]; YPosObst=new int[noOfObstaclesLevel]; XPosOfSpaceship=getWidth()/2-35; YPosOfSpaceship=getHeight()-100; spaceshipImage=getImage(new URL(getCodeBase(),spaceshipImagePath)); for(int i=0;i<noOfObstaclesLevel;i++) { asteroidImage[i]=getImage(new URL(getCodeBase(),obstacleImagepath)); XPosObst[i]=(int) (Math.random()*700); YPosObst[i]=0; } MediaTracker tracker = new MediaTracker (this); for(int i=0;i<noOfObstaclesLevel;i++) { tracker.addImage (asteroidImage[i], 0); } } catch (MalformedURLException e) { e.printStackTrace(); } setBackground(Color.black); addKeyListener(this); } public void paint(Graphics g) { g.setColor(Color.white); if(gameStart==false) { g.drawString(buttonToStart, (getWidth()/2)-60, getHeight()/2); } g.drawString("HEADfitted Solutions Pvt.Ltd.", (getWidth()/2)-80, getHeight()-20); for(int n=0;n<numberOfObstacles;n++) { if(n>0) g.drawImage(asteroidImage[n],XPosObst[n],YPosObst[n],this); } g.drawImage(spaceshipImage,XPosOfSpaceship,YPosOfSpaceship,this); } @SuppressWarnings("deprecation") public void update(Graphics g) { d = size(); if((offScreenImage == null) || (d.width != offScreenSize.width) || (d.height != offScreenSize.height)) { offScreenImage = createImage(d.width, d.height); offScreenSize = d; offScreenGraphics = offScreenImage.getGraphics(); } offScreenGraphics.clearRect(0, 0, d.width, d.height); paint(offScreenGraphics); g.drawImage(offScreenImage, 0, 0, null); } public void keyReleased(KeyEvent arg0){} public void keyTyped(KeyEvent arg0) {} Thread mainThread=new Thread() { synchronized public void run () { try { //System.out.println("in main thread"); if (gameStart==true) { moveObstacles.start(); if(collide()==false) { createObsThread.start(); } } } catch (Exception e) { e.printStackTrace(); } } }; Thread createObsThread=new Thread() { synchronized public void run () { if (spaceButtnCntr==1) { if (collide()==false) { for(int g=0;g<noOfObstaclesLevel;g++) { try { sleep(1000); } catch (InterruptedException e) { e.printStackTrace(); } numberOfObstacles++; } } } } }; Thread moveObstacles=new Thread() // Moving Obstacle images downwards after every 10 ms { synchronized public void run () { while(YPosObst[19]!=600) { if (collide()==false) { //createObsThread.start(); for(int l=0;l } repaint(); try { sleep(10); } catch (InterruptedException e) { e.printStackTrace(); } } } } }; public void keyPressed(KeyEvent e) { if(e.getKeyCode()==32) { gameStart=true; spaceButtnCntr++; if (spaceButtnCntr==1) { mainThread.start(); } } if(gameStart==true) { if(e.getKeyCode()==37 && collideLeft==false)//Spaceship movement left { new Thread () { synchronized public void run () { XPosOfSpaceship-=10; repaint(); } }.start(); } if(e.getKeyCode()==38 && collideUp==false)//Spaceship movement up { new Thread () { synchronized public void run () { YPosOfSpaceship-=10; repaint(); } }.start(); } if(e.getKeyCode()==39 && collideRight==false)//Spaceship movement right { new Thread () { synchronized public void run () { XPosOfSpaceship+=10; repaint(); } }.start(); } if(e.getKeyCode()==40 && collideDown==false)//Spaceship movement down { new Thread () { synchronized public void run () { YPosOfSpaceship+=10; repaint(); } }.start(); } } } /*public boolean collide() { int x0, y0, w0, h0, x2, y2, w2, h2; x0=XPosOfSpaceship; y0=YPosOfSpaceship; h0=spaceshipImage.getHeight(null); w0=spaceshipImage.getWidth(null); for(int i=0;i<20;i++) { x2=XPosObst[i]; y2=YPosObst[i]; h2=asteroidImage[i].getHeight(null); w2=asteroidImage[i].getWidth(null); if ((x0 > (x2 + w2)) || ((x0 + w0) < x2)) return false; System.out.println(x2+" "+y2+" "+h2+" "+w2); if ((y0 > (y2 + h2)) || ((y0 + h0) < y2)) return false; } return true; }*/ public boolean collide() { int x1,y1,x2,y2,x3,y3,x4,y4; //coordinates of obstacles int a1,b1,a2,b2,a3,b3,a4,b4; //coordinates of spaceship a1 =XPosOfSpaceship; b1=YPosOfSpaceship; a2=a1+spaceshipImage.getWidth(this); b2=b1; a3=a1; b3=b1+spaceshipImage.getHeight(this); a4=a2; b4=b3; for(int a=0;a if(x1>=a1 && x1<=a2 && x1<=b3 && x1>=b1) return (true); if(x2>=a1 && x2<=a2 && x2<=b3 && x2>=b1) return(true); //********checking asteroid touch spaceship from up direction******** if(y3==b1 && x4>=a1 && x4<=a2) { collideUp = true; return(true); } if(y3==b1 && x3>=a1 && x3<=a2) { collideUp = true; return(true); } //********checking asteroid touch spaceship from left direction****** if(x2==a1 && y4>=b1 && y4<=b3) { collideLeft=true; return(true); } if(x2==a1 && y2>=b1 && y2<=b3) { collideLeft=true; return(true); } //********checking asteroid touch spaceship from right direction***** if(x1==a2 && y3>=b2 && y3<=b4) { collideRight=true; return(true); } if(x1==a2 && y1>=b2 && y1<=b4) { collideRight=true; return(true); } //********checking asteroid touch spaceship from down direction***** if(y1==b3 && x2>=a3 && x2<=a4) { collideDown=true; return(true); } if(y1==b3 && x1>=a3 && x1<=a4) { collideDown=true; return(true); } else { collideUp=false; collideDown=false; collideLeft=false; collideRight=false; } } return(false); } } `

    Read the article

  • Can I add round cornres to HtmlPanelGrid in code or in page? If yes - how?

    - by Elena
    Hi all! I have a task - add round corners to HtmlPanelGrid. Now I am trying to do it with css (using 4 images for each corner - that css create our designer). I load css and try to do this in my code: this.grid = new HtmlPanelGrid(); this.grid.setStyleClass("toplist,toplist-top"); But no changes I could see in my page. I tried to load css and use it with tags, but it also didnt work and created one more problem - my jsf didn't reload and redisplay: <div class="toplist"> <div class="toplist-top"><h2>Top 10 List</h2></div> <div class="toplist-bg"> <div class="toplist-cont"> <rich:tab label="Top-List" id="screenTop"> <h:panelGrid id="topListTable" binding="#{chartBean.topListTable}" /> </rich:tab> <a4j:support event="onclick" reRender="menuSection" actionListener="#{chartBean.doChangeTab}" /> </div> </div> <div class="toplist-bottom"></div> </div> I am interesting of adding round corners to topListTable in the code. How can I do it? I load my css as: <link href="#{facesContext.externalContext.requestContextPath}/css/stylesheet.css" rel="styleSheet" type="text/css"/> If anybody knows, how can I add corners to the panelGrid. Sorry for stupid question, but I am newborn in jsf and richfaces, and I want to solve this task right Thanks!

    Read the article

  • RedirectToAction and validate MVC 2

    - by Dan
    Hi, my problem is the View where the user typed, the validation. I have to take RedirectToAction on the site because on the site upload a file. Thats my code. My model class public class Person { [Required(ErrorMessage= "Please enter name")] public string name { get; set; } } My View <%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<MvcWebRole1.Models.Person>" %> Name <h2>Information Data</h2> <%= Html.ValidationSummary() %> <%using (Html.BeginForm ("upload","Home", FormMethod.Post, new{ enctype ="multipart/form-data" })) {%> <fieldset> <legend>Fields</legend> <p> <label for="name">name:</label> <%= Html.TextBox("name") %> <%= Html.ValidationMessage("name", "*") %> </p> </fieldset> <% } %> and the Controller [AcceptVerbs(HttpVerbs.Post)] public ActionResult upload(FormCollection form) { Person lastname = new Person(); lastname.name = form["name"]; return RedirectToAction("Index"); } Thx for answer my question In advance

    Read the article

  • "echo" in functions or "echo" all page?

    - by jasmine
    Is this a good method to save to all index in a variable and then echo this? for example <?php $txt='<!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=iso-8859-9" /> <link rel="stylesheet" type="text/css" href="css/style.css"/> <title>Untitled Document</title> </head> <body> <div class="wrapper"> <div class="header"> <h2>'.heaf_func().'</h2> </div> <div class="content">content</div> <div class="footer">footer</div> </div> </body> </html>'; echo $txt; ?>

    Read the article

  • Sending wordpress title-value across PHP-pages

    - by VoodooBurger
    I recently made this wordpress blog, where you can sign up a team for an event, when clicking a link under the event post. This link takes you to a sign-up form on another php-page. The link is added in the loop of the events-template like this: <?php query_posts('cat=8');?> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <div class="post" id="post-<?php the_ID(); ?>"> <h2><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2> <div id="tilmeldknap"><?php wp_list_pages("title_li=&depth=1&include=63"); ?></div> <?php include (TEMPLATEPATH . '/inc/meta.php' ); ?>... So every upcoming event will have the same sign-up button. All I need now is to somehow send the specific event-post-title along to the sign-page, so that the following form-submit action will contain that title aswell. But since I'm not very good at php it seems like a mystery, altho I bet it's very simple! I'm guessing it's something like: $event=$_POST['single_post_title()'] But how to get the value to the next php-page I have no idea... please help, anyone :) An eksample can be seen throught this link: http://gadebold.dk/events/ The link sais: 'Tilmeld Hold'

    Read the article

  • need help passing multiple variables from foreach loop to test in switch case statement

    - by Brad
    $list_of_groups = array("FACULTY","STAFF"); foreach ($list_of_groups as $i => $group) { $user_in_group = $adldap->user_ingroup($username,$group); print "<h2>Group: ".$group." user in group? ".$user_in_group."</h2>"; // if 1, means yes } Need to print run the appropriate function based on what returns true. There are user's that are members of both FACULTY and STAFF groups, so I want to check for those users and display the appropriate content for them. So if the user is both faculty and staff, then display this, if they are only of staff, display that, same for faculty, might not make sense, but I will write out some code "in theory" that will help you understand what I am trying to do switch(Get group membership of user) { case "FACULTY": print "Faculty group member"; break; case "STAFF": print "Staff group member"; break; case "FACULTY and STAFF": print "Member of both faculty and staff"; break; } I am unsure on how it will check if they are members of both groups and run that thru the case statement to display the appropriate message. The foreach look currently runs thru every group the user belongs to, prints out the ones from the $list_of_groups and the number 1 to the right of it, signifying they belong to it. The problem I have is trying to use that information to run thru the case statement, I am unsure of how to go about that. This is what it prints out for the user currently passed thru the foreach loop: Group: FACULTY user in group? 1 Group: STAFF user in group? 1 Any help is appreciated.

    Read the article

  • has_many, belongs_to and comment forms

    - by Koning Baard XIV
    I'm having two models: Snippet and SnippetComment. These also have their own controllers, as well as views. In /app/views/snippets/show.html.erb I have a form that starts like this: <% form_for(@new_snippet_comment) do |form| %> SnippetComment belongs to one Snippet, and a Snippet belongs to one User. This means that I have this routing: map.resources :users do |user| user.resources :snippets do |snippet| snippet.resources :snippet_comments, :as => "comments" end end So when I submit the SnippetComment form in the SnippetController#show view, this request should be made: POST /users/x/snippets/x/comments HTTP/1.1 (where x is the User's or Snippet's id). The problem is that I don't even get the comment submission form, but rahter this: NoMethodError in Snippets#show Showing app/views/snippets/show.html.erb where line #29 raised: undefined method `snippet_comments_path' for Extracted source (around line #29): 26: <% if current_user %> 27: <h2>Schrijf een nieuwe reactie</h2> 28: 29: <% form_for(@new_snippet_comment) do |form| %> 30: 31: <p> 32: <%= form.text_area :body %> RAILS_ROOT: /Users/jeffatwood/Dev/youjustdontneedmyrealname Application Trace | Framework Trace | Full Trace /Users/jeffatwood/.gem/ruby/1.8/gems/actionpack-2.3.5/lib/action_controller/polymorphic_routes.rb:107:in `__send__' /Users/jeffatwood/.gem/ruby/1.8/gems/actionpack-2.3.5/lib/action_controller/polymorphic_routes.rb:107:in `polymorphic_url' /Users/jeffatwood/.gem/ruby/1.8/gems/actionpack-2.3.5/lib/action_controller/polymorphic_routes.rb:114:in `polymorphic_path' /Users/jeffatwood/.gem/ruby/1.8/gems/actionpack-2.3.5/lib/action_view/helpers/form_helper.rb:298:in `apply_form_for_options!' /Users/jeffatwood/.gem/ruby/1.8/gems/actionpack-2.3.5/lib/action_view/helpers/form_helper.rb:277:in `form_for' /Users/jeffatwood/Dev/youjustdontneedmyrealname/app/views/snippets/show.html.erb:29:in `_run_erb_app47views47snippets47show46html46erb' /Users/jeffatwood/Dev/youjustdontneedmyrealname/app/controllers/snippets_controller.rb:19:in `show' Request Parameters: {"id"=>"1", "user_id"=>"2"} Show session dump Response Headers: {"Content-Type"=>"text/html", "Cache-Control"=>"no-cache"} Can anyone help me with this problem? Thanks

    Read the article

  • Can't place a breakpoint in asp.net master page file

    - by Tony_Henrich
    I have an MVC web application. I get an "Object reference not set to an instance of an object" error in line 16 below. It's a master page file. When I try to place a breakpoint in that line or anywhere in the file, I get a "this is not a valid location for a breakpoint" error. I have clicked on every line and I can't place a single breakpoint. I do have lines which have code only. How do I place a breakpoint in this file? Note: I can place breakpoints in code files. In some other aspx files, I can place a breakpoint in some code lines and some not. Does the inline code have to be in a special format to place a breakpoint? Using VS 2010 in Windows 7 64bit. Code: Line 14: <div id="<%= Model.PageWidth %>" class="<%= Model.PageTemplate %>"> Line 15: <div id="hd"> Line 16: <h1><a href="/"><%= Model.Workspace.Title %></a></h1> Line 17: <h2><%= Model.Workspace.Subtitle %></h2> Line 18: </div>

    Read the article

  • JQuery datepicker not working

    - by IniTech
    I'm completely new to JQuery and MVC. I'm working on a pet project that uses both to learn them and I've hit my first snag. I have a date field and I want to add the JQuery datepicker to the UI. Here is what I have done: Added <script src="../../Scripts/jquery-1.3.2.min.js" type="text/javascript"></script> to the site.master Inside my Create.aspx (View), I have <asp:Content ID="Create" ContentPlaceHolderID="MainContent" runat="server"> <h2> Create a Task</h2> <% Html.RenderPartial("TaskForm"); %> </asp:Content> and inside "TaskForm" (a user control) I have: <label for="dDueDate"> Due Date</label> <%= Html.TextBox("dDueDate",(Model.Task.TaskID > 0 ? string.Format("{0:g}",Model.Task.DueDate) : DateTime.Today.ToString("MM/dd/yyyy"))) %> <script type="text/javascript"> $(document).ready(function() { $("#dDueDate").datepicker(); }); </script> As you can see, the above checks to see if a task has an id 0 (we're not creating a new one) if it does, it uses the date on the task, if not it defaults to today. I would expect the datepicker UI element to show up, but instead I get: "Microsoft JScript runtime error: Object doesn't support this property or method" on the $("#dDueDate").datepicker(); Ideas? It is probably a very simple mistake, so don't over-analyze. As I said, this is the first time I've dealt with MVC or JQuery so I'm lost as to where to start.

    Read the article

  • MVC view engine that can render classic ASP?

    - by David Lively
    I'm about to start integrating ASP.NET MVC into an existing 200k+ line classic ASP application. Rewriting the existing code (which runs an entire business, not just the public-facing website) is not an option. The existing ASP 3.0 pages are quite nicely structured (given what was available when this model was put into place nearly 15 years ago), like so: <!--#include virtual="/_lib/user.asp"--> <!--#include virtual="/_lib/db.asp"--> <!--#include virtual="/_lib/stats.asp"--> <!-- #include virtual="/_template/topbar.asp"--> <!-- #include virtual="/_template/lftbar.asp"--> <h1>page name</h1> <p>some content goes here</p> <p>some content goes here</p> <p>.....</p> <h2>Today's Top Forum Posts</h2> <%=forum_top_posts(1)%> <!--#include virtual="/_template/footer.asp"--> ... or somesuch. Some pages will include function and sub definitions, but for the most part these exist in include files. I'm wondering how difficult it would be to write an MVC view engine that could render classic ASP, preferably using the existing ASP.DLL. In that case, I could replace <!--#include virtual="/_lib/user.asp"--> with <%= Html.RenderPartial("lib/user"); %> as I gradually move existing pages from ASP to ASP.NET. Since the existing formatting and library includes are used very extensively, they must be maintained. I'd like to avoid having to maintain two separate versions. I know the ideal way to go about this would be to simply start a new app and say to hell with the ASP code, however, that simply ain't gonna happen. Ideas?

    Read the article

  • change image use javascript DOM

    - by user289346
    <html> <head> <script type="text/javascript"> var curimage = "cottage_small.jpg"; var curtext = "View large image"; function changeSrc() { if (curtext == "View large image"||curimage == "cottage_small.jpg") { document.getElementById("boldStuff").innerHTML = "View small image"; curtext="View small image"; document.getElementById("myImage")= "cottage_large.jpg"; curimage = "cottage_large.jpg"; } else { document.getElementById("boldStuff").innerHTML = "View large image"; curtext = "View large image"; document.getElementById("myImage")= "cottage_small.jpg"; curimage = "cottage_small.jpg"; } } </script> </head> <body> <!-- Your page here --> <h1> Pink Knoll Properties</h1> <h2> Single Family Homes</h2> <p> Cottage:<strong>$149,000</strong><br/> 2 bed, 1 bath, 1,189 square feet, 1.11 acres <br/><br/> <a href="#" onclick="changeSrc()"><b id="boldStuff" />View large image</a> </p> <p><img id="myImage" src="cottage_small.jpg" alt="Photo of a cottage" /></p> </body> </html> This is my coding I need to change the image and text the same time when I click it. I use LTS, it shows the line document.getElementById("myImage")= "cottage_large.jpg"; is a wrong number of arquments or invalid property assigment. Dose someone can help? Bianca

    Read the article

  • Php sting handling triks

    - by Dam
    Hi my question Need to get the 10 word before and 10 words after for the given text . i mean need to start the 10 words before the keyword and end with 10 word after the key word. Given text : "Twenty-three" The main trick the having some html tags tags need to keep that tag with this content only the words from 10before - 10after content is bellow : <div id="hpFeatureBoxInt"><h2><span class="dy">Top News Story</span></h2><h3><a href="/go/homepage/i/int/news/world/1/-/news/1/hi/world/europe/8592190.stm">Suicide bombings hit Moscow Metro</a></h3><p>Past suicide bombings in Moscow have been blamed on Islamist rebels At least 35 people have been killed after two female suicide bombers blew themselves up on Moscow Metro trains in the morning rush hour, officials say.<img height="150" width="201" alt="Emergency services carry a body from a Metro station in Moscow (29 March 2010)" src="http://wwwimg.bbc.co.uk/feedengine/homepage/images/_47550689_moscowap203_201x150.jpg">Twenty-three died in the first blast at 0756 (0356 GMT) as a<a href="#"> train stood </a>at the central Lubyanka station, beneath the offices of the FSB intelligence agency.About 40 minutes later, a second explosion ripped through a train at Park Kultury, leaving another 12 dead.No-one has said they carried out the worst attack in the capital since 2004. </p><p id="fbilisten"><a href="/go/homepage/i/int/news/heading/-/news/">More from BBC News</a></p></div> Thank you

    Read the article

  • Traversing from Bookmark Hashtags (#bookmark) in jQuery?

    - by HipHop-opatamus
    I am having trouble traversing from a bookmark has tag in jquery. Specifically, the following HTML: <a id="comment-1"></a> <div class="comment"> <h2 class="title"><a href="#comment-1">1st Post</a></h2> <div class="content"> <p>this is 1st reply to the original post</p> </div> <div class="test">1st post second line</div> </div> I am trying to traverse to where the class = "title", if the page is landed on with a bookmark hashtag in the URL (site.com/test.html#comment-1). The following is my code I'm using for testing: if(window.location.hash) { alert ($(window.location.hash).nextAll().html()); } It executes fine, and returns the appropriate html ( The problem is if I add a selector to it ($(window.location.hash).next('.title').html() ) I get a null result. Why is this so? Is nextAll not the correct Traversing function? (I've also tried next+find to no avail) Thanks!

    Read the article

  • ASP.NET OleDbConnection Problem

    - by Matt
    I'm working on an ASP.NET website where I am using an asp:repeater with paging done through a VB.NET code-behind file. I'm having trouble with the database connection though. As far as I can tell, the paging is working, but I can't get the data to be certain. The database is a Microsoft Access database. The function that should be accessing the database is: Dim pagedData As New PagedDataSource Sub Page_Load(ByVal obj As Object, ByVal e As EventArgs) doPaging() End Sub Function getTheData() As DataTable Dim DS As New DataSet() Dim strConnect As New OleDbConnection("Provider = Microsoft.Jet.OLEDB.4.0;Data Source=App_Data/ArtDatabase.mdb") Dim objOleDBAdapter As New OleDbDataAdapter("SELECT ArtID, FileLocation, Title, UserName, ArtDate FROM Art ORDER BY Art.ArtDate DESC", strConnect) objOleDBAdapter.Fill(DS, "Art") Return DS.Tables("Art").Copy End Function Sub doPaging() pagedData.DataSource = getTheData().DefaultView pagedData.AllowPaging = True pagedData.PageSize = 2 Try pagedData.CurrentPageIndex = Int32.Parse(Request.QueryString("Page")).ToString() Catch ex As Exception pagedData.CurrentPageIndex = 0 End Try btnPrev.Visible = (Not pagedData.IsFirstPage) btnNext.Visible = (Not pagedData.IsLastPage) pageNumber.Text = (pagedData.CurrentPageIndex + 1) & " of " & pagedData.PageCount ArtRepeater.DataSource = pagedData ArtRepeater.DataBind() End Sub The ASP.NET is: <asp:Repeater ID="ArtRepeater" runat="server"> <HeaderTemplate> <h2>Items in Selected Category:</h2> </HeaderTemplate> <ItemTemplate> <li> <asp:HyperLink runat="server" ID="HyperLink" NavigateUrl='<%# Eval("ArtID", "ArtPiece.aspx?ArtID={0}") %>'> <img src="<%# Eval("FileLocation") %>" alt="<%# DataBinder.Eval(Container.DataItem, "Title") %>t"/> <br /> <%# DataBinder.Eval(Container.DataItem, "Title") %> </asp:HyperLink> </li> </ItemTemplate> </asp:Repeater>

    Read the article

  • '$.fn' is null or not an object

    - by metal-gear-solid
    Problem 1 Error: Microsoft JScript runtime error: '$.fn' is null or not an object Error area: $.fn.apply=function(item,content,header){ $(".featureBox"+item).css('z-index', "1000"); $("img.featureBox" + item +"top").attr("src",basepath + "box-big-top.jpg"); $("img.featureBox" + item +"imgcut").attr("src",basepath + "box-big-img"+item+".jpg"); featureboxcont[item].attr("src",basepath + "box-big-cont.jpg"); $("img.featureBox" + item +"foot").attr("src",basepath + "box-big-bot2.jpg"); //$("#NoteModalDialog > #x-dlg-bd > #x-dlg-tab > #acc-ct") $("#box"+item+"headtext > .h2div > h2").text(header); $("#box"+item+"bottext").css({"top":"181px","width":"205px","font-size":"12px","color":"#ffffff","left":"10"}); $("#box"+item+"foottext").css({"top":footheight+"px","width":"215px","left":"20"}); $("#box"+item+"hidden").css({"display":"block"}); $("#box"+item+"bottext").text(content); $("#box"+item+"headtext > .h2div > h2").removeClass("sIFR-replaced"); callsIFR(); } Problem 2 Error : Microsoft JScript runtime error: 'null' is null or not an object Error area : $("#innerWrapper").addClass("js-version"); I'm also using protoype.js on page.

    Read the article

  • jQuery Tools alert works once (but only once)

    - by Jim Miller
    I'm trying to build a simple alert mechanism with jQuery Tools -- in response to a bit of Javascript code, pop up an overlay with a message and an OK button that, when clicked, makes the overlay go away. Trivial, or it should be. I've been slavishly following http://flowplayer.org/tools/demos/overlay/trigger.html, and have something that works fine the first time it's invoked, but only that time. If I repeat the JS action that should expose the overlay, it doesn't. My content/DIV: <div class='modal' id='the_alert'> <div id='modal_content' class='modal_content'> <h2>hi there</h2> this is the body <p> <button class='close'>OK</button> </p> </div> <div id='modal_background' class='modal_background'><img src='/images/overlay/f9f9f9-180.png' class='stretch' alt='' /></div> </div> and the Javascript: function showOverlayDialog() { $('#the_alert').overlay({ mask: {color: '#cccccc', loadSpeed: 200, opacity: 0.9}, closeOnClick: false, load: true }); } As I said: When showOverlayDialog() is invoked the first time, the overlay appears just like it should, and goes away when the "OK" button is clicked. But if I cause showOverlayDialog() to run again, without reloading the page, nothing happens. If I reload the page, then the pattern repeats -- the first invocation brings up the overlay, but the second one doesn't. I'm obviously missing something -- any advice out there? Thanks!

    Read the article

  • How can I display a language according to the user's browser's language inside this code?

    - by janoChen
    How can I display a language according to the user's browser's language inside this mini-framework for my multilingual website? Basically, it has to display the default language of the user if there's no cookies. Example of index.php: (rendered output) <h2><?php echo l('tagline_h2'); ?></h2> common.php: (controller of which language to output) <?php session_start(); header('Cache-control: private'); // IE 6 FIX if(isSet($_GET['lang'])) { $lang = $_GET['lang']; // register the session and set the cookie $_SESSION['lang'] = $lang; setcookie("lang", $lang, time() + (3600 * 24 * 30)); } else if(isSet($_SESSION['lang'])) { $lang = $_SESSION['lang']; } else if(isSet($_COOKIE['lang'])) { $lang = $_COOKIE['lang']; } else { $lang = 'en'; } //use appropiate lang.xx.php file according to the value of the $lang switch ($lang) { case 'en': $lang_file = 'lang.en.php'; break; case 'es': $lang_file = 'lang.es.php'; break; case 'tw': $lang_file = 'lang.tw.php'; break; case 'cn': $lang_file = 'lang.cn.php'; break; default: $lang_file = 'lang.en.php'; } //translation helper function function l($translation) { global $lang; return $lang[$translation]; } include_once 'languages/'.$lang_file; ?> Example of /languages/lang.en.php: (where multilingual content is being stored) <?php $lang = array( 'tagline_h2' => '...',

    Read the article

  • Perl - MySQL connection problem in windows

    - by dexter
    I have two folders php and perl they contain index.php and index.pl respectivly in index.pl my perl code looks like: #!/usr/bin/perl use Mysql; print "Content-type: text/html\n\n"; print "<h2>PERL-mySQL Connect</h2>"; print "page info"; $host = "localhost"; $database = "cdcol"; $user = "root"; $password = ""; $db = Mysql->connect($host, $database, $user, $password); $db->selectdb($database); when i run above code (ie type: http://localhost:88/perl/ in browser) following error comes Error message: Can't locate Mysql.pm in @INC (@INC contains: C:/xampp/perl/site/lib/ C:/xampp/perl/lib C:/xampp/perl/site/lib C:/xampp/apache) at C:/xampp/htdocs/perl/index.pl line 2. BEGIN failed--compilation aborted at C:/xampp/htdocs/perl/index.pl line 2. while this works: in browser http://localhost:88/php/ where index.php has: <?php $con = mysql_connect("localhost","root",""); if($con) { if(mysql_select_db("cdcol", $con)) { $sql="SELECT Id From products"; if(mysql_query($sql)) { $result = mysql_query($sql); if ($result)............

    Read the article

< Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >