|
Peter Roman wrote: <img src="D:/Pictures/JIT.png" width="347" height ="176" />
You can't use local paths to display an image on a website. You need to use a URL, either absolute (src="http://yoursite/pictures/jit.png" ), relative to the current site (src="/pictures/jit.png" ), or relative to the current page (src="pictures/jit.png" ).
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Thanks for the response bro i really appreciate it,
i think i'm mainly worried about making the image not a button (so that a hand clicker icon for the mouse doesn't appear) and then making the register and login button come out of hiding as well as displaying the login and/or register forms whenever clicked, hiding the other if switched all on the same page. it might not be possible or impractical or whatever but the image source right now is sort of arbitrary in terms of example although i appreciate what you're saying.
so yeah, if you know how to do that pls let me know where i can find the resource for that![Java | [Coffee]](https://codeproject.global.ssl.fastly.net/script/Forums/Images/coffee.gif)
|
|
|
|
|
What you're describing is a single-page application[^]. There are various frameworks around to help create SPAs - for example:
An SPA is quite an ambitious project to start with. It would probably be easier to start with a more traditional multi-page application, at least until you get familiar with HTML, CSS and Javascript.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
okay cool, thanks.
i mean i'm not totally new new like i didn't start yesterday. i've coded some in college but that was a c++ course, and then of course there's resources like khan academy which only teach so much you know?
i think embarking on an ambitious project is okay if there's help around, which clearly there is since people that know what they're doing like you are here to respond haha. i'm not in a rush but i do want this website to look simple, neat, and clean, so some of the traditional website styles aren't exactly my taste.
plus when all is said and done, i think that this is probably going to be a life-long project that i'm going to focus on, so like it's my first and my last? unless i branch out in the future, but yeah. i want to get it right the first time, even if it takes a little less than forever =]
|
|
|
|
|
It's actually straightforward enough - no need to go the whole SPA route.... IMO too much of web programming these days is all about using sledgehammers to crack nuts.
Simply wrap your image-button and your registration form in div tags, adn set that of the reg form to be hidden to start with.
<div style="display:none;" id="reg-form">
then, on the user clicking the image call a JavaScript function that reverses the hidden attributes of both divs.
That's the general principle, anyway.
|
|
|
|
|
thanks, but i have no idea for what the code is after all that stuff you said, haha. what is the code for hidden to start with? and also how do i reverse the hidden attibutes?
|
|
|
|
|
With all due respect then, I think perhaps you need to start with some basics before worrying about building a site.... http://www.w3schools.com/[^] is a good reference place for starting out.
However - below is a very basic page showing the essence of what you're after - but don't expect me or anyone else here to do your work for you. Learn what you can, try things, and ask questions on specific things you get stuck on.
<html>
<head>
<title></title>
<style type="text/css">
.show {
display:inline;
top:0;
left:0;
width:100%;
height:100%;
}
.noshow {
display:none;
}
.handy {
cursor:pointer;
}
</style>
<script type="text/javascript">
function enterSite() {
document.getElementById("splash").className = "noshow";
document.getElementById("login").className = "show";
}
</script>
</head>
<body>
<div id="splash">
<img src="relative path to image" onclick="enterSite()" alt="Click to enter site" class="handy" />
</div>
<div id="login" class="noshow">
<h2>Log in here</h2>
</div>
</body>
</html>
|
|
|
|
|
|
Just remove that value from the textarea. Notify the user of these actions like,
<p>Please do not enter the following in the textarea, they will be removed.</p>
<ul>
<li>@</li>
<li>dotcom</li>
<li>.com</li>
<li>dot</li>
</ul>
<textarea placeholder="Message..."
name="message_content" id="message_content"
style="width:100%;" rows="9"></textarea>
Now once user has submitted it, you can remove them using, (well if jQuery)
var val = $('#message_content').val().replace('dotcom', '')
.replace('dot', '')
.replace('@', '')
.replace('.com', '')
Another method is also available, in which you simply ignore that input. For example, if user presses "@" key. You ignore the input by using "return false;".
$('#message_content').keydown(function (e) {
if(e.which == code_for_@) {
return false;
}
});
But I will personally recommend the above provided method, user would know what he is doing and if he enter that data, it will be removed from input.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
Hi. I need difference between givendate and datetime.now in javascript.
I don't want to make it a clumsy seperating date, month, year from dates and then getting difference.
I'm looking for a solution that can get the result in 1 or 2 steps.
|
|
|
|
|
|
Is there a way to use toUpperCase and length on an array of 20 elements without typing each element out in an array?
|
|
|
|
|
What are you trying to accomplish?
|
|
|
|
|
Sure, like this
> var array = ["Eeny", "meeny", "miny", "moe"];
> array.forEach((i) => { console.log(`${i.toUpperCase()} ${i.length}`); });
EENY 4
MEENY 5
MINY 4
MOE 3
Using ES6 for brevity.
modified 6-Apr-21 21:01pm.
|
|
|
|
|
I'm a student and have an assignment where we are supposed to prompt for 20 names and then use an Array to output the names. I was wondering if there is a shorter way to write the code for the 20 name prompts? Right now I am writing a var statement for each name prompt. And then how do I get the names in the Array?
|
|
|
|
|
|
Have they not covered for loops yet?
var myArray = [];
for(var i = 0;i < 20;i++)
{
myArray[i] = NameGettingFunction();
}
This is just about the most basic iterative construct, and it will serve you always.
Or you can have 20 different prompt vars. The point of most CS classes is to get you to think about possible solutions. I get that the toolbox is a little empty right now, but learning some basic principles like iteration and recursion will get you much closer to the place that you need to be.
|
|
|
|
|
No we haven't gotten to loops yet. He said we were going to go back to this assignment later for loops. Thanks
|
|
|
|
|
That works for the prompts, but how do I get the names to output? Right now I am getting numbers with document.write.
|
|
|
|
|
Exactly the same way, but with your output instead.
|
|
|
|
|
Hi all,
I have a website form and it pops up a certain alert when the user enters some specific value in a text box. Now, I want to quantify those alerts, set up a counter and store that value in a SQL db table. Any ideas/examples on this would be much appreciated. Thanks!
|
|
|
|
|
You'll need to modify the function that pops up the alert to also call a handler of some sort, using an AJAX call, on your server to do this. SO you'll require some kind of server-side trechnology, whether it be .NET, php or whatever.
|
|
|
|
|
Hello Team
I will try with the help of colorize but it not work properly.
My basic problem is that i want to do change color of image when user select color tone tab then color tab will open if user click on a particular color on this tab the image color will change please help me
Thanks & Regards
Rajiv Rahi
|
|
|
|
|
Hi,
i am trying to use pyQT and python to get the dynamic content from a web page. The problem is that i still only get the static content. What could be wrong with the code below?
Code is based on this link: https://impythonist.wordpress.com/2015/01/06/ultimate-guide-for-scraping-javascript-rendered-web-pages/[^]
import sys
import time
from PyQt4.QtGui import *
from PyQt4.QtCore import *
from PyQt4.QtWebKit import *
from lxml.html import fromstring, tostring, iterlinks
class Render(QWebPage):
def __init__(self, url):
self.app = QApplication(sys.argv)
QWebPage.__init__(self)
self.loadFinished.connect(self._loadFinished)
self.mainFrame().load(QUrl(url))
self.app.exec_()
print("inside 1")
def _loadFinished(self, result):
self.frame = self.mainFrame()
self.app.quit()
print("inside 2")
url = 'http://www.somepage.com'
r = Render(url)
print("inside 3")
print("Sleeping..")
time.sleep(5)
print("Sleeping done")
result = r.mainFrame().toHtml()
print(result.encode('utf-8'))
I added the sleep(5) to ensure that the dynamic content has time to load but is does not help.
Why doesn't the r.mainFrame() contain the valid dynamically created page contents? Is it not updated after the pageloaded event?
Regards
|
|
|
|
|